SVProgressHUD is not working when open an app through click notification in iOS

121 Views Asked by At

I have already implemented SVProgressHUD to other pages into app. In this app notification feature is exist. when I received notification and then clicked it open an home page then navigate specific page. In this situation I want when I click notification that time I want to show SVProgressHUD until to navigate specific page. I have already implemented SVProgressHUD functionality under 'registerForPushNotification' method but it's not working. It's working after navigate to specific page. So I don't understand what can I do. Please any one help me out. Is it possible?

1

There are 1 best solutions below

0
Dhaval Bhimani On

in didFinishLaunchingWithOptions, add this:

//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"];
}

Hope this will help ;)