srikanth
srikanth

Reputation: 53

Handle push notification when device is idle

I have implemented Apple Push notification service. I have a requirement that I need to execute code in the device when a notification is received. When I followed the documentation, I found that there are two ways to do this

  1. application:didReceiveRemoteNotification --> this is invoked if the app is running

  2. application:didFinishLaunchingWithOptions--> this is invoked if the app is brought to foreground because of the alert message view button.

But my requirement is different. I need to execute code when the app is in the background and also when the device is idle. Any thought how i can do it?

Thanks -Srikanth

Upvotes: 1

Views: 457

Answers (1)

Michaël
Michaël

Reputation: 6734

You cannot do this with push notifications when the app is sleeping.

Upvotes: 1

Related Questions