Commit bafe8b5e authored by PKnittel's avatar PKnittel
Browse files
parents 8a3ca729 f0f3d4c0
Loading
Loading
Loading
Loading
+5 −2
Changes for CHANGELOG.md: 5 added lines, 2 removed lines.
Original line number Diff line number Diff line
## ChangeLog
#### Version 0.8.0 (not yet released)
- [feature:] New method `hasPermission` to ask if the user has granted to display local notifications.
- [feature:] New method `registerPermission` to register permission to display local notifications.
- [feature:] New Android specific `led:` flag.
- [feature:] Add `isTriggered` & `getTriggeredIds` methods.
- [enhancement:] iOS8 support.
- [enhancement:] Android 2.x (SDK >= 7) support (Thanks to **khizarsonu**)
- [enhancement:] Scope parameter for `isScheduled` and `getScheduledIds`
- [enhancement:] Callbacks for `add`, `cancel` & `cancelAll`
- [enhancement:] `image:` accepts remote URLs and local URIs (Android)
- [feature:] New Android specific `led:` flag.
- [feature:] Add `isTriggered` & `getTriggeredIds` methods.

#### Version 0.7.4 (22.03.2014)
- [bugfix:] Platform specific properties were ignored.
+46 −15
Changes for README.md: 46 added lines, 15 removed lines.
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ The purpose of the plugin is to create an platform independent javascript interf


## Supported Platforms
- **iOS**<br>
- **iOS** _(up to iOS8)_<br>
See [Local and Push Notification Programming Guide][ios_notification_guide] for detailed informations and screenshots.

- **Android** *(SDK >=7)*<br>
@@ -70,12 +70,15 @@ More informations can be found [here][PGB_plugin].

## ChangeLog
#### Version 0.8.0 (not yet released)
- [feature:] New method `hasPermission` to ask if the user has granted to display local notifications.
- [feature:] New method `registerPermission` to register permission to display local notifications.
- [feature:] New Android specific `led:` flag.
- [feature:] Add `isTriggered` & `getTriggeredIds` methods.
- [enhancement:] iOS8 support.
- [enhancement:] Android 2.x (SDK >= 7) support (Thanks to **khizarsonu**)
- [enhancement:] Scope parameter for `isScheduled` and `getScheduledIds`
- [enhancement:] Callbacks for `add`, `cancel` & `cancelAll`
- [enhancement:] `image:` accepts remote URLs and local URIs (Android)
- [feature:] New Android specific `led:` flag
- [feature:] Add `isTriggered` & `getTriggeredIds` methods.

#### Further informations
- See [CHANGELOG.md][changelog] to get the full changelog for the plugin.
@@ -85,18 +88,20 @@ More informations can be found [here][PGB_plugin].
## Using the plugin
The plugin creates the object ```window.plugin.notification.local``` with the following methods:

1. [notification.local.add][add]
2. [notification.local.cancel][cancel]
3. [notification.local.cancelAll][cancelall]
4. [notification.local.isScheduled][isscheduled]
5. [notification.local.getScheduledIds][getscheduledids]
6. [notification.local.isTriggered][istriggered]
7. [notification.local.getDefaults][getdefaults]
8. [notification.local.setDefaults][setDefaults]
9. [notification.local.onadd][onadd]
10. [notification.local.ontrigger][ontrigger]
11. [notification.local.onclick][onclick]
12. [notification.local.oncancel][oncancel]
1. [notification.local.hasPermission][has_permission]
2. [notification.local.registerPermission][register_permission]
3. [notification.local.add][add]
4. [notification.local.cancel][cancel]
5. [notification.local.cancelAll][cancelall]
6. [notification.local.isScheduled][isscheduled]
7. [notification.local.getScheduledIds][getscheduledids]
8. [notification.local.isTriggered][istriggered]
9. [notification.local.getDefaults][getdefaults]
10. [notification.local.setDefaults][setdefaults]
11. [notification.local.onadd][onadd]
12. [notification.local.ontrigger][ontrigger]
13. [notification.local.onclick][onclick]
14. [notification.local.oncancel][oncancel]

### Plugin initialization
The plugin and its methods are not available before the *deviceready* event has been fired.
@@ -107,6 +112,30 @@ document.addEventListener('deviceready', function () {
}, false);
```

### Determine if the app does have the permission to show local notifications
If the permission has been granted through the user can be retrieved through the `notification.local.hasPermission` interface.<br/>
The method takes a callback function as its argument which will be called with a boolean value. Optional the scope of the callback function ca be defined through a second argument.

#### Further informations
- The method is supported on each platform, however its only relevant for iOS8 and above.

```javascript
window.plugin.notification.local.hasPermission(function (granted) {
    // console.log('Permission has been granted: ' + granted);
});
```

### Register permission for local notifications
Required permissions can be registered through the `notification.local.registerPermission` interface.

#### Further informations
- The method is supported on each platform, however its only relevant for iOS8 and above.
- The user will only get a prompt dialog for the first time. Later its only possible to change the setting via the notification center.

```javascript
window.plugin.notification.local.registerPermission();
```

### Schedule local notifications
Local notifications can be scheduled through the `notification.local.add` interface.<br>
The method takes a hash as an argument to specify the notification's properties and returns the ID for the notification.<br>
@@ -533,6 +562,8 @@ This software is released under the [Apache 2.0 License][apache2_license].
[oncancel]: #get-notified-when-a-local-notification-has-been-canceled
[ontrigger]: #get-notified-when-a-local-notification-has-been-triggered
[platform-specific-properties]: #platform-specifics
[has_permission]: #determine-if-the-app-does-have-the-permission-to-show-local-notifications
[register_permission]: #register-permission-for-local-notifications
[add]: #schedule-local-notifications
[cancel]: #cancel-scheduled-local-notifications
[cancelall]: #cancel-all-scheduled-local-notifications
+9 −0
Changes for plugin.xml: 9 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -35,6 +35,15 @@

        <header-file src="src/ios/APPLocalNotification.h" />
        <source-file src="src/ios/APPLocalNotification.m" />

        <header-file src="src/ios/APPLocalNotificationOptions.h" />
        <source-file src="src/ios/APPLocalNotificationOptions.m" />

        <source-file src="src/ios/UIApplication+APPLocalNotification.h" />
        <source-file src="src/ios/UIApplication+APPLocalNotification.m" />

        <header-file src="src/ios/UILocalNotification+APPLocalNotification.h" />
        <source-file src="src/ios/UILocalNotification+APPLocalNotification.m" />
    </platform>

    <!-- android -->
+4 −0
Changes for src/ios/APPLocalNotification.h: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -36,5 +36,9 @@
- (void) isScheduled:(CDVInvokedUrlCommand*)command;
// Retrieves a list of ids from all currently pending notifications
- (void) getScheduledIds:(CDVInvokedUrlCommand*)command;
// Informs if the app has the permission to show notifications
- (void) hasPermission:(CDVInvokedUrlCommand*)command;
// Registers permission to show notifications
- (void) registerPermission:(CDVInvokedUrlCommand*)command;

@end
+185 −361

File changed.

Preview size limit exceeded, changes collapsed.

Loading