Skip to content
This repository has been archived by the owner on Jun 21, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Moses Hohman committed Sep 27, 2016
1 parent ff3df9b commit 82d3d11
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ - (void)processOpenUrl:(NSURL*)url pageLoaded:(BOOL)pageLoaded

dispatch_block_t handleOpenUrl = ^(void) {
// calls into javascript global function 'handleOpenURL'
NSString* jsString = [NSString stringWithFormat:@"document.addEventListener('deviceready',function(){if (typeof handleOpenURL === 'function') { handleOpenURL(\"%@\");}});", url.absoluteString];
// Re: window._savedOpenURL, see https://github.com/EddyVerbruggen/Custom-URL-scheme/issues/2#issuecomment-152557017
NSString* jsString = [NSString stringWithFormat:@"if (typeof handleOpenURL === 'function') { handleOpenURL(\"%@\");} else { window._savedOpenURL = \"%@\"; }", url.absoluteString, url.absoluteString];

[weakSelf.webViewEngine evaluateJavaScript:jsString completionHandler:nil];
};
Expand Down

0 comments on commit 82d3d11

Please sign in to comment.