简体   繁体   中英

didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler not called

I'm trying push notifications and want to increase the badge number but

didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler   

is not called in inactive state or background state.

I'm currently working in iOS 9 and Xcode 7.3.

check once are you enabled or not

在此处输入图片说明

there after the method is called

didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler

at the same time check this link also

In your notification payload you have to send "content-available":1

Also, this blog post will help you. http://samwize.com/2015/08/07/how-to-handle-remote-notification-with-background-mode-enabled/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM