1

Is there a way to wake up the app on receiving remote notifications?

If I delete the app from app preview, I don't get the remote notification. On getting the notification I have to download few images.

How do I achieve this?

Evaldas Buinauskas
  • 13,739
  • 11
  • 55
  • 107
Akshara
  • 141
  • 1
  • 11
  • Which images You have downloaded? – Uma Madhavi Oct 19 '15 at 11:32
  • If you terminate the app from the app switcher by swiping up then the app will not be relaunched in the background until the user launches the app again from the app icon or a notification – Paulw11 Oct 19 '15 at 11:48
  • Possible duplicate of [Will iOS launch my app into the background if it was force-quit by the user?](http://stackoverflow.com/questions/19068762/will-ios-launch-my-app-into-the-background-if-it-was-force-quit-by-the-user) – NSPratik Oct 19 '15 at 13:58

2 Answers2

2

I think you want to use the content-available key in your payload:

Provide this key with a value of 1 to indicate that new content is available. Including this key and value means that when your app is launched in the background or resumed, application:didReceiveRemoteNotification:fetchCompletionHandler: is called.

Stephen Darlington
  • 51,577
  • 12
  • 107
  • 152
0

You can change your target's launch settings in "Manage Scheme" to Wait for <app>.app to be launched manually, which allows you debug by setting a breakpoint in application: didReceiveRemoteNotification: fetchCompletionHandler: and sending the push notification to trigger the background launch.

NSPratik
  • 4,714
  • 7
  • 51
  • 81
  • didReceiveRemoteNotification is not getting called when notification is sent from server while the app is in background. When the app is in foreground the function gets called. But why is it not getting called in background? I have tested by inserting a value to database in didReceiveRemoteNotification function. Value is not getting inserted. How do I make this work? Please help – Akshara Oct 19 '15 at 16:40