Created
April 2, 2014 04:51
-
-
Save inoccu/9928127 to your computer and use it in GitHub Desktop.
PhoneGap(iOS)でカスタムURLスキームを実装する ref: http://qiita.com/inoccu/items/3eabc960ad6216ffbda3
This file contains 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
NSString* jsString = [NSString stringWithFormat:@"window.handleOpenURL(\"%@\");", url]; |
This file contains 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
window.handleOpenURL = (param) -> | |
window.debug "handleOpenURL #{param}" | |
[scheme, param] = param.toLowerCase().split("://") | |
if scheme == "sayhello" | |
alert "Hello, #{param}!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment