ios - In Apache Cordova, why are LocalNotifications handled by the default AppDelegate file, but not remote (push) notifications? -


i've been trying impliment localnotifications in cordova, , found bunch of out of date plugins, nothing totally current. noticed in cordova source localnotifications handled, broadcast listening plugins:

// repost localnotification using default nsnotificationcenter multiple plugins may respond - (void)            application:(uiapplication*)application     didreceivelocalnotification:(uilocalnotification*)notification {     // re-post ( broadcast )     [[nsnotificationcenter defaultcenter] postnotificationname:cdvlocalnotification object:notification]; } 

but there no similar handling push notifications. phongap-build push notifications plugin uses calles "method swizzling" add method appdelegate.m

it seems standard appdelegate should both or neither, or there fundamental local notifications means lots of plugins may want listen them?

are there examples of how write plugin listens notification cordova posts? localnotifications plugins have found tell make modifications appdelegate.m file manually part of setup.

edit: jira bug added localnotifications core.

i updated this plugin use app, based on cordova 2.5.0, should work versions update 2.9

the plugin 1 requires modifications appdelegate.m, agree bit evil, needed working solution , had pragmatic it.

you can download xcode test project from here. contains updated plugin code , modified appdelegate.m, example usage.


Comments