1.直接跳轉(zhuǎn)到 App Store?
1.進(jìn)入appstore中指定的應(yīng)用
NSString *str = [NSString stringWithFormat:
@"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa /wa/viewContentsUserReviews?type=Purple+Software&id=%d",
myAppID ];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
其中myAppID為itunesconnect中的應(yīng)用程序id
2.進(jìn)入首頁(yè)
NSString *str = [NSString stringWithFormat:
@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=%@",
m_myAppID ];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
2.在應(yīng)用內(nèi)打開(kāi)
//設(shè)置代理請(qǐng)求為當(dāng)前控制器本身
SKStoreProductViewController*storeProductViewContorller = [[SKStoreProductViewControlleralloc] init];
//加載一個(gè)新的視圖展示
storeProductViewContorller.delegate =self;
//appId唯一的
[storeProductViewContorller loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier:@"1049660516"} completionBlock:^(BOOLresult,NSError*error) {//block回調(diào)
if(error){
NSLog(@"error %@ with userInfo %@",error,[error userInfo]);? ?
?}else{//模態(tài)彈出
appstore[selfpresentViewController:storeProductViewContorller animated:YEScompletion:^{? ? ? ? }? ? ?
?? ? ];? ??
} }]
//取消按鈕監(jiān)聽(tīng)
- (void)productViewControllerDidFinish:(SKStoreProductViewController*)viewController{? ? [selfdismissViewControllerAnimated:YEScompletion:^{? ? }];
}
3.跳轉(zhuǎn)到評(píng)論
NSString *appstoreUrlString = [NSString stringWithFormat:
@"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@",
m_appleID ];
NSURL * url = [NSURL URLWithString:appstoreUrlString];
if ([[UIApplication sharedApplication] canOpenURL:url]){
[[UIApplication sharedApplication]openURL:url];
}else {
NSLog(@"can not open");
}