cordova-plugin-notificationcenter
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "cordova-plugin-notificationcenter", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "iOS NSNotificationCenter Bridge", | ||
@@ -17,3 +17,3 @@ "cordova": { | ||
"cordova", | ||
"notification", | ||
"notificationCenter", | ||
"NSNotificationCenter", | ||
@@ -20,0 +20,0 @@ "ecosystem:cordova", |
# cordova-plugin-notificationcenter | ||
Bridge between iOS NSNotificationCenter and JavaScript. | ||
[Cordova plugin](https://www.npmjs.com/package/cordova-plugin-notificationcenter) | ||
> Bridge between iOS NSNotificationCenter and JavaScript. | ||
There are tons of notifications that get posted by various components in the iOS SDK. | ||
> There are tons of notifications that get posted by various components in the iOS SDK. | ||
Sometimes it can be useful to observe these native notifications in JavaScript. | ||
@@ -12,5 +13,9 @@ | ||
```js | ||
cordova.plugins.notificationCenter.addObserver("NSManagingContextDidSaveChangesNotification",function(){console.log("NSManagingContextDidSaveChangesNotification has been sent");}); | ||
cordova.plugins.notificationCenter.addObserver('NSManagingContextDidSaveChangesNotification',function(){ | ||
console.log('NSManagingContextDidSaveChangesNotification has been sent'); | ||
}); | ||
cordova.plugins.notificationCenter.addObserver('UIDeviceOrientationDidChangeNotification',function(){console.log("UIDeviceOrientationDidChangeNotification has been sent");}); | ||
cordova.plugins.notificationCenter.addObserver('UIDeviceOrientationDidChangeNotification',function(){ | ||
console.log('UIDeviceOrientationDidChangeNotification has been sent'); | ||
}); | ||
``` | ||
@@ -20,3 +25,3 @@ Remove a specific observer : | ||
```js | ||
cordova.plugins.notificationCenter.removeObserver("NSManagingContextDidSaveChangesNotification"); | ||
cordova.plugins.notificationCenter.removeObserver('NSManagingContextDidSaveChangesNotification'); | ||
``` | ||
@@ -26,6 +31,6 @@ | ||
```js | ||
cordova.plugins.notificationCenter.removeAllObservers() | ||
cordova.plugins.notificationCenter.removeAllObservers(); | ||
``` | ||
Enter the debug mode in order to observe all native notifications (do not use this in production ! It's a performance killer) : | ||
Enter the debug mode in order to observe all native notifications ( :warning: do not use this in production ! It's a performance killer ) : | ||
```js | ||
@@ -32,0 +37,0 @@ cordova.plugins.notificationCenter.startDebug(); |
@@ -23,3 +23,3 @@ var exec = require('cordova/exec'), | ||
* | ||
* @name stopDebug | ||
* @name removeAllObservers | ||
*/ | ||
@@ -26,0 +26,0 @@ NotificationCenter.prototype.removeAllObservers = function () { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14511
40