0

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.

Jack Greenhill
  • 10,240
  • 12
  • 38
  • 70
  • In inactive state or back ground state you do not have the control over your App's push notification, so it wont get called until you open the app by tapping on the notification from the notification list of device. – Janmenjaya Sep 19 '16 at 06:32
  • 1
    plz read this link http://stackoverflow.com/questions/36929869/push-notification-not-receiving-in-background-ios/36934771#36934771 – balkaran singh Sep 19 '16 at 06:34
  • @Janmenjaya then how would the badge no would increase.. if we try from the api end they can not keep a record for no of notifications sent – saksha nagpal Sep 19 '16 at 07:34

2 Answers2

0

check once are you enabled or not

enter image description here

there after the method is called

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

at the same time check this link also

Community
  • 1
  • 1
Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143
0

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/

Kumar
  • 1,882
  • 2
  • 27
  • 44