<commit_before># HKRLocalNotificationManager [![build status](https://api.travis-ci.org/hokuron/HKRLocalNotificationManager.png?branch=master)](https://travis-ci.org/hokuron/HKRLocalNotificationManager)

HKRLocalNotificationManager is a safe schedule manager of local notification.  

## Features

* Prevents the duplication schedule.
* Useful methods to schedule.
* When `UILocalNotification` is stocked once, and application moved to a background, it is done a schedule all at once.

## Installing

### CocoaPods

Add the following to your `Podfile`.

```
pod 'HKRLocalNotificationManager'
```

### Manual

Add `HKRLocalNotificationManager/HKRLocalNotificationManager.{h,m}` to your project.

## Usage

### Scheduling a local notification without action

```objectivec
[[HKRLocalNotificationManager sharedManager] scheduleNotificationOn:specificDate
                                                               body:@"alert body"
                                                           userInfo:nil
                                                            options:nil];
```

And immediate…

```objectivec
[[HKRLocalNotificationManager sharedManager] presentNotificationNowWithBody:@"alert body"
                                                                   userInfo:nil
                                                                    options:nil];
```

### Scheduling a local notification with action

```objectivec
[[HKRLocalNotificationManager sharedManager] scheduleNotificationWithAction:@"action title"
                                                                     onDate:specificDate
                                                                       body:@"alert body"
                                                                   userInfo:nil
                                                                    options:nil];
```

And immediate...

```objectivec
[[HKRLocalNotificationManager sharedManager] presentNotificationNowWithAction:@"action title"
                                                                       body:@"alert body"
                                                                   userInfo:nil
                                                                    options:nil];
```

### What is `options` in arguments?

`options` in the argument of the above method can specify a value of property of UILocalNotification using NSDictionary.  
  
Example sets the value of `applicationIconBadgeNumber` using the `options`.

```objectivec
[[HKRLocalNotificationManager sharedManager] presentNotificationNowWithBody:@"alert body"
                                                                   userInfo:nil
                                                                    options:@{@"applicationIconBadgeNumber": @10}];
```

### Canceling a local notification in system or stacked

If you want to cancel a local notification that you scheduled using the methods above, please do use the following methods always.  

```objectivec
[[HKRLocalNotificationManager sharedManager] cancelNotification:specificLocalNotification];
```

```objectivec
[[HKRLocalNotificationManager sharedManager] cancelAllNotifications];
```

### Set default sound name

You can specify the soundName used in local notification of all. you can also override it using `options`. defaults to `UILocalNotificationDefaultSoundName`.<commit_msg>Mod: readme<commit_after># HKRLocalNotificationManager [![build status](https://api.travis-ci.org/hokuron/HKRLocalNotificationManager.png?branch=master)](https://travis-ci.org/hokuron/HKRLocalNotificationManager)

HKRLocalNotificationManager is a safe schedule manager of local notification.  

## Features

* Prevents the duplication schedule.
* Useful methods to schedule.
* When `UILocalNotification` is stocked once, and application moved to a background, it is done a schedule all at once.

## Installing

### CocoaPods

Add the following to your `Podfile`.

```
pod 'HKRLocalNotificationManager'
```

### Manual

Add `HKRLocalNotificationManager/HKRLocalNotificationManager.{h,m}` to your project.

## Usage

### Scheduling a local notification without action

```objectivec
[[HKRLocalNotificationManager sharedManager] scheduleNotificationOn:specificDate
                                                               body:@"alert body"
                                                           userInfo:nil
                                                            options:nil];
```

And immediate…

```objectivec
[[HKRLocalNotificationManager sharedManager] presentNotificationNowWithBody:@"alert body"
                                                                   userInfo:nil
                                                                    options:nil];
```

### Scheduling a local notification with action

```objectivec
[[HKRLocalNotificationManager sharedManager] scheduleNotificationWithAction:@"action title"
                                                                     onDate:specificDate
                                                                       body:@"alert body"
                                                                   userInfo:nil
                                                                    options:nil];
```

And immediate...

```objectivec
[[HKRLocalNotificationManager sharedManager] presentNotificationNowWithAction:@"action title"
                                                                         body:@"alert body"
                                                                     userInfo:nil
                                                                      options:nil];
```

### What is `options` in arguments?

`options` in the argument of the above method can specify a value of property of UILocalNotification using NSDictionary.  
  
Example sets the value of `applicationIconBadgeNumber` using the `options`.

```objectivec
[[HKRLocalNotificationManager sharedManager] presentNotificationNowWithBody:@"alert body"
                                                                   userInfo:nil
                                                                    options:@{@"applicationIconBadgeNumber": @10}];
```

### Canceling a local notification in system or stacked

If you want to cancel a local notification that you scheduled using the methods above, please do use the following methods always.  

```objectivec
[[HKRLocalNotificationManager sharedManager] cancelNotification:specificLocalNotification];
```

```objectivec
[[HKRLocalNotificationManager sharedManager] cancelAllNotifications];
```

### Set default sound name

You can specify the soundName used in local notification of all. you can also override it using `options`. defaults to `UILocalNotificationDefaultSoundName`.
{'fraction_non_alphanumeric': 0.0703332350339133, 'fraction_numerical': 0.0005897965202005308, 'mean_word_length': 1.7439320388349515, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 64, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '843031', 'n_tokens_mistral': 1394, 'n_tokens_neox': 1285, 'n_words': 422}