通过iOS中的点击通知打开应用程序时,SVProgressHUD无法正常工作

问题描述 投票:0回答:1

我已经将SVProgressHUD实现到app中的其他页面。在此应用程序中,通知功能已存在。当我收到通知然后单击它打开主页然后导航特定页面。在这种情况下,我希望当我点击通知时,我想显示SVProgressHUD,直到导航特定页面。我已经在'SVProgressHUD'方法下实现了registerForPushNotification功能,但它不起作用。导航到特定页面后它正在工作。所以我不明白我能做什么。请任何人帮助我。可能吗?

objective-c push-notification xcode8 ios9 svprogresshud
1个回答
0
投票

在didFinishLaunchingWithOptions中,添加:

//redirect to notification list if its from push notification click
NSMutableDictionary *notification = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];

if (notification)
{
    //this notification dictionary is same as your JSON payload whatever you gets from Push notification you can consider it as a userInfo dic in last parameter of method -(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
    NSLog(@"%@",notification);
    [SVProgressHUD showWithStatus:@"Please Wait"];
}

希望这会有所帮助;)

© www.soinside.com 2019 - 2024. All rights reserved.