Created
November 28, 2011 19:08
-
-
Save shazron/1401563 to your computer and use it in GitHub Desktop.
PhoneGap Remove Notifications to JavaScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo | |
| { | |
| NSString* jsString = [NSString stringWithFormat:@"MyFunction(%@)", [dict JSONString]]; | |
| [self.webView stringByEvaluatingJavaScriptFromString:jsString]; | |
| } | |
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| { | |
| NSDictionary* dict = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; | |
| if (dict && [dict isKindOfClass:[NSDictionary class]]) | |
| { | |
| NSString* jsString = [NSString stringWithFormat:@"MyFunction(%@)", [dict JSONString]]; | |
| [self.webView stringByEvaluatingJavaScriptFromString:jsString]; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment