Created
June 28, 2013 03:32
-
-
Save ms2sato/5882304 to your computer and use it in GitHub Desktop.
UIWebViewではURLSchemeでのアプリ起動ができない? ref: http://qiita.com/ms2sato/items/648fc6f6d0837c6ebeda
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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
</head> | |
<body> | |
<a href="gamecenter:">ゲームセンター</a> | |
</body> | |
</html> |
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
- (BOOL)webView:(UIWebView *)aWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { | |
//こうしないと起動できなかった。Safariでリンクを押した時は起動できるけどね。 | |
if([[[request URL] scheme] isEqual:@"gamecenter"]){ | |
[[UIApplication sharedApplication] openURL:[request URL]]; | |
return NO; | |
} | |
} | |
return YES; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment