commit | f99f938347ca7e9e1bd9b15ed95afd74f9fd4041 | [log] [tgz] |
---|---|---|
author | Shazron Abdullah <shazron@gmail.com> | Thu May 11 11:11:59 2017 -0700 |
committer | Shazron Abdullah <shazron@gmail.com> | Thu May 11 11:11:59 2017 -0700 |
tree | 2d8816010e920c32ff6fde1a80d2e2a81d9ce8cf | |
parent | 819a3ed7482a1fd71a617a3cf2cf18072f844fae [diff] |
CB-12798 - updated version, added package.json
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>