我不知道如何在后台处理推送通知。
要在后台处理推送通知,请按以下步骤进行:
- In Capabilities -> Enable Remote notification.
- In Capabilities -> Background Mode -> Enable Remote notifications.
- In didFinishLaunchingWithOptions give all permission for ios 10.
- For push notification used
UNUserNotificationCenter
. App In Foreground then push notification is working fine and below method call :
userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
我的问题是当应用程序在后台时,不调用任何方法。如果有人对如何处理iOS 10后台推送通知的想法或解决方案,请帮助我。
谢谢。