Receive a warning message when an application is open in the background. When I close the application from the background when the application starts, it does not give me a message. handleOpenURL cannot reference JavaScript the first time the application is launched. Below is the code
didFinishLaunchingWithOptions Code
NSURL* url = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey]; NSString* invokeString = nil; if (url) { invokeString = [url absoluteString]; NSLog(@"iPaperReeder launchOptions = %@", url); } self.viewController.invokeString = invokeString;
AppDelgate.m
if (!url) { return NO; } NSString* jsString = [NSString stringWithFormat:@"window.setTimeout(function(){ handleOpenURL(\"%@\"); }, 1)", url]; [self.viewController.webView stringByEvaluatingJavaScriptFromString:jsString];
It should output javascript to this function:
function handleOpenURL(url) { alert('invoke: ' + url); }
Please help me.
javascript ios phonegap-build
Tarun kumar
source share