Вопрос

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?

Это было полезно?

Решение

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(@" - ");
} 
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top