iOS Apple Push Notification Service Alert Box
i am ne开发者_JS百科w to APNS of iOS infact new to iOS development too.
I was successful on Implementing APNS with the help of Easy APNS.. but when it comes to Alert Box i want the below functionality
Once the user clicks on View Button on the Alert Box i want the Application to Load and then the redirected to the URL Passed though the Alert Box Msg.
Can Any one give me some idea about the same ..
Thanks and regards Any help would be high Appreciated
In your object that implements UIApplicationDelegate
implement method:
Sent to the delegate when a running application receives a remote notification:
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo;
And in
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
you should check if:
NSDictionary *userInfo = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
if (userInfo != nil)
Then when all conditions are met you could get value of your alert
property of push-notification from userInfo
dictionary:
The userInfo dictionary contains another dictionary that you can obtain using the aps key. You can access the contents of the aps dictionary—though you shouldn’t need to in most cases—using the following keys:....
I don't want to copy+paste all Apple docs, just read more about this here: UIApplicationDelegate Protocol Reference
When you will have the value of url you can open it, for example, in such manner:
[[UIApplication sharedApplication] openURL:[request URL]];
Or using UIWebView Class Reference create your own mini-internet browser to view contents of the url.
精彩评论