commit | 819a3ed7482a1fd71a617a3cf2cf18072f844fae | [log] [tgz] |
---|---|---|
author | Shazron Abdullah <shazron@gmail.com> | Wed Feb 22 11:24:25 2017 -0800 |
committer | Shazron Abdullah <shazron@gmail.com> | Wed Feb 22 11:24:25 2017 -0800 |
tree | 87ded733e21d75fa58d6f53b1d25da44d42c636c | |
parent | 8f39c7015bfb46cc20c6bd71777a40347a8cec5e [diff] |
Removed plugins other than notification-rebroadcast, moved plugin to root
See CB-8475. This plugin rebroadcasts remote push notifications as well as local notifications to other plugins.
This plugin currently needs to use the 4.0.x
branch of cordova-ios
.
To alpha test
this:
You may have to remove the cached 4.0.x platform:
rm -rf ~/.cordova/lib/ios/cordova/4.0.x
Then:
cordova create nrtest my.project.id nrtest cd nrtest cordova platform add ios@4.0.x --usegit cordova plugin add https://github.com/apache/cordova-plugins.git#master:notification-rebroadcast
Listen for these 3 types of document events in JavaScript:
CDVLocalNotification
data is a JSON object of the UILocalNotification details
CDVRemoteNotification
data is a JSON object containing one key, "token" which is the push device token
CDVRemoteNotificationError
data is a JSON object containing one key, "error", which is the localized error message
document.addEventListener('CDVLocalNotification', function(event) { console.log(event.data); }); document.addEventListener('CDVRemoteNotification', function(event) { console.log(event.data.token); }); document.addEventListener('CDVRemoteNotificationError', function(event) { console.log(event.data.error); });
<feature name="CDVNotificationRebroadcast"> <param name="ios-package" value="CDVNotificationRebroadcast" /> <param name="onload" value="true" /> </feature>