5

iOS 7 Silent Push Notification doesn't work in background when application not connected to the xcode.

I used following payload and when application is in background/foreground/background & connected to the xcode, control comes in application:didReceiveRemoteNotification:fetchCompletionHandler method

but when application is in background and not connected to the xcode this method never gets called.

The payload used:

{ "content-available": 1, "sound": ""}

Bhagyashree
  • 169
  • 8
  • may want to try the 'priority' property as discussed here http://stackoverflow.com/questions/19239737/silent-push-notification-in-ios-7-does-not-work?rq=1 – gro Dec 04 '15 at 21:18

4 Answers4

2

Seems like the payload is incorrect. It needs to children to the "aps" key.

grandnasty
  • 739
  • 6
  • 21
0

You need to check what running state your application is in. Apple isn't clear about it but the app needs to already be in the multi task screen before silent push works.

Source (my own post, we have deployed this) http://heywiretech.tumblr.com/post/67471006073/multitasking-in-ios7

anurodhp
  • 356
  • 5
  • 13
0

Is your app have permissions to present notifications? If no this can lead to silent fail, so add logging and check again.

sage444
  • 5,661
  • 4
  • 33
  • 60
  • Yes, all is working in iOS8 and iOS9. but not in iOS7. I was wondering why. – HelmiB Dec 01 '15 at 09:53
  • Oh, If a recall right permission logic was changed somewhere in between iOS 7 and 8 and that can be your case, but i'm not sure – sage444 Dec 01 '15 at 09:56
  • Yes, I did that too. see this question, I posted seperately - http://stackoverflow.com/q/34017393/554740 – HelmiB Dec 01 '15 at 10:00
  • I see you already checked all easy cases:)) so I wont ask you about background modes in info.plist – sage444 Dec 01 '15 at 10:04
0

enter image description here

Don't forget to turn the Background Modes on in the target's Capabilities.

Rain
  • 320
  • 2
  • 7