Skip to content

Instantly share code, notes, and snippets.

@ms2sato
Created June 28, 2013 03:32
Show Gist options
  • Save ms2sato/5882304 to your computer and use it in GitHub Desktop.
Save ms2sato/5882304 to your computer and use it in GitHub Desktop.
UIWebViewではURLSchemeでのアプリ起動ができない? ref: http://qiita.com/ms2sato/items/648fc6f6d0837c6ebeda
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<a href="gamecenter:">ゲームセンター</a>
</body>
</html>
- (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