javascript - IOS Local Notifications not working with PhoneGap -
i'm having trouble displaying local notifications in ios phonegap-app. have tried both katzer local notifications plugin (https://github.com/katzer/cordova-plugin-local-notifications#schedule-local-notifications) , wizcorp local notifications plugin (https://github.com/wizcorp/phonegap-plugin-localnotifications) neither works me. after installing both plugins can access respective javascript objects , wizcorp plugin can manipulate application badge, cant seem add local notification. makes me believe problem lies elsewhere in application/installation.
i've tried both plugins on both ios emulator , phonegap developer app.
edit: trying working plugin example code:
var = new date().gettime(), _60_seconds_from_now = new date(now + 60*1000); window.plugin.notification.local.add({ id: 1, title: 'reminder', message: 'dont forget buy flowers.', repeat: 'weekly', date: _60_seconds_from_now });
make sure have registered app local notifications. not done automatically when add plugin.
for example (in app delegate application:didfinishlaunchingwithoptions: method):
[application registerusernotificationsettings: [uiusernotificationsettings settingsfortypes: uiusernotificationtypealert|uiusernotificationtypebadge|uiusernotificationtypesound categories:nil]];
Comments
Post a Comment