Question

If app is not in background, push notification came. Clicking on launch button will not show push notification, it will just open app, for opening of that push notification we have to tap again on push notification from notification tray. Any way with launch we can show notification also?

Était-ce utile?

La solution

This is resolved. Answer was:

(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

NSDictionary *tmpDic = [launchOptions objectForKey:@"UIApplicationLaunchOptionsRemoteNotificationKey"];

//if tmpDic is not nil, then your app is launched due to an APNs push, therefore check this NSDictionary for further information
if (tmpDic != nil) {
    NSLog(@" - launch options dict has something ");
    NSLog(@" - badge number is %@ ", [[tmpDic objectForKey:@"aps"] objectForKey:@"badge"]);
    NSLog(@" - ");
} 
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top