ios - userNotificationCenter willPresentNotification Overriding application didRecieveNotifiction in Dev but not Prod -
very odd problem i've been stuck @ while.
im working on code base has notification center handles remote notifications, appdelegate handles remote notifications.
// notification center handler
@available(ios 10.0, *) func usernotificationcenter(center: unusernotificationcenter, willpresentnotification notification: unnotification, withcompletionhandler completionhandler: (unnotificationpresentationoptions) -> void) { log.debug("@appdelegate: willpresentnotification: \(notification)") }
// app delegate notification handler
func application(application: uiapplication, didreceiveremotenotification userinfo: [nsobject : anyobject], fetchcompletionhandler completionhandler: (uibackgroundfetchresult) -> void) { log.debug("@appdelegate: didreceiveremotenotification: \(notification)" }
the strange behaviour having push notifications seem work on production (when build app store). however, when send push notifications in dev, usernotificationcenter willpresentnotification
handler fires application didreceiveremotenotification
not fire.
i can't test why seems work in production (since can't attach debugger) don't quite understand why seems happening.
do know why usernotificationcenter willpresentnotification
may (or may not) intercept application didreceiveremotenotification
in production vs dev (or other reason might intercept notification handler)? when remove usernotificationcenter
code standard didreceiveremotenotification
fires in dev.
any insight appreciated thank you.
wiki
Comments
Post a Comment