Victor Pham
Victor Pham

Reputation: 63

Handling Apple Push Notification when app is inactive

I wonder how lookout www.lookout.com implement there scream functionality on ios. Since when the app is in inactive mode(The user pressed home button) , there's no way to handle the notification (since didReceiveRemoteNotification is not called ). So how did they make the phone scream when receiving notification unless customizing the alert sound but I don't think that is the case. Any ideas?

Upvotes: 0

Views: 1760

Answers (1)

Amit
Amit

Reputation: 1043

You can override the method :

  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
   if (launchOptions != nil) {
       apnsDict=[launchOptions objectForKey:@"UIApplicationLaunchOptionsRemoteNotificationKey"];
    //handle more here
    }
}

If you have received any notification while your app was inactive, you will get this condition true in this method whenever you will open your application.

Upvotes: 1

Related Questions