i am sending push payload to my users with the follow content :
{"aps": {"alert": "Go To Google", "sound": "Default","url":"http://www.google.com"}}
everything goes well when the pp is running but in the background. if i am receiving the push and the app is closed i am open it and nothing happen. i am trying to redirect to this url in the payload. again when the app is running from the background it goes well.
this is the implementation so far AppDelegate.m:
-(void)Redirect:(NSString*)url{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
NSLog(@"%@",url);
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
RedirectedUri = [[userInfo objectForKey:@"aps"] objectForKey:@"url"];
NSLog(@"%@",RedirectedUri);
[self Redirect:RedirectedUri];
}
need some help please.