【问题标题】:SVProgressHUD is not working when open an app through click notification in iOS通过 iOS 中的点击通知打开应用程序时,SVProgressHUD 不起作用
【发布时间】:2017-12-22 07:15:02
【问题描述】:
我已经将SVProgressHUD 实现到应用程序的其他页面。在这个应用程序通知功能是存在的。当我收到通知然后单击它打开主页然后导航特定页面时。在这种情况下,我希望在单击通知时显示SVProgressHUD 直到导航特定页面。我已经在 'registerForPushNotification' 方法下实现了SVProgressHUD 功能,但它不起作用。导航到特定页面后它正在工作。所以我不明白我能做什么。请任何人帮助我。有可能吗?
【问题讨论】:
标签:
objective-c
push-notification
xcode8
ios9
svprogresshud
【解决方案1】:
在 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"];
}
希望这会有所帮助;)