0

When my app is running, push notifications work as expected via the ReceivedRemoteNotification method. But when I send the app a push notification while the app is not running, I am expecting the received push notification to launch the app and call FinishedLaunching, but I'm not seeing that at all. Any ideas as to what I'm missing?

The problem must be in one of three places, Apple developer certificate side, app code side, or plist file. Because push notifications are working when the app is running it seems the certificates are working correctly. Since the FinishedLaunching method isn't getting called at all, there's no point in checking the logic there. So there must be an issue with the Plist file or a solution setting right?

enter image description here

enter image description here

LampShade
  • 2,675
  • 5
  • 30
  • 60
  • 1
    `while the app is not running` Are you saying the app has not yet been run manually by the user and/or manually killed from the switcher? – SushiHangover Apr 16 '16 at 19:12
  • Say I have an external server that's sending the app a push notification. If the app is running when that server sends me the push notification, it is received successfully. But if I kill the app (double tap home button and swipe up) so the app is not running at all, I would expect the received push notification to launch the app in the background and call the FinishedLaunching method – LampShade Apr 16 '16 at 19:23
  • 1
    If you kill the app, iOS will NOT restart your app. See the SO answer that I linked http://stackoverflow.com/a/19202487/4984832 Been there, done that :-) We switched to PushKit – SushiHangover Apr 16 '16 at 19:25
  • This is a dup of those issues. Thanks guys. – LampShade Apr 18 '16 at 15:48

1 Answers1

0

If the app isn't running only a silent notification will wake up your app. The only other way your app is notified on a non-silent notification is when the user taps the received notification in the notification center. See Apple's documentation section "Configuring a Silent Notification" where you add the content-available property.

https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/TheNotificationPayload.html#//apple_ref/doc/uid/TP40008194-CH107-SW1

DannyC
  • 401
  • 4
  • 15
  • That may not be the case from what i"m reading here http://stackoverflow.com/questions/34291002/can-apples-silent-push-notifications-launch-my-app-in-the-background. I'm going to go with PushKit and VOIP as the others have. – LampShade Apr 18 '16 at 15:51