我有一個應用程序鏈接,使用來自AppStore的鏈接製造商。我在我的應用中有一個UIWebView
,我試圖加載鏈接UIWebView
,但每次加載該鏈接時都會打開內置AppStore,而不是顯示UIWebView
中的內容。我想打開鏈接UIWebView
而不是打開內置的iOS AppStore。從UIwebview打開並安裝iOS應用程序
這是我試圖
- (void)viewDidLoad
{
str = @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa";
str = [NSString stringWithFormat:@"%@/wa/viewContentsUserReviews?", str];
str = [NSString stringWithFormat:@"%@type=Purple+Software&id=", str];
// Here is the app id from itunesconnect
str = [NSString stringWithFormat:@"%@289382458", str];
[webOpenApp loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:str]]];
}
-(BOOL) webView:(UIWebView *)inWeb
shouldStartLoadWithRequest:(NSURLRequest *)inRequest
navigationType:(UIWebViewNavigationType)inType
{
if (inType == UIWebViewNavigationTypeOther) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
return NO;
}
return YES;
}
你可以添加問題的鏈接?如果鏈接有重定向到App Store的HTML標題,您可以更改標題,如果它的網站。如果沒有,你可以做什麼 –
你可以給我一個添加HTML標題的示例。 – user3115014