admin管理员组

文章数量:1662623

1. 获取应用的链接地址

打开iTunes,搜索应用的名称,点击倒三角按钮,选择拷贝链接

2. 跳转

1、iOS原生应用跳转:(通过AppStore App,推荐使用)

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"app的链接"]];

2、html5应用跳转, 这里分为两种方式。一种直接写个\ 标签,一种是利用js

<a href="itms-apps://itunes.apple/cn/app/jie-zou-da-shi/id493901993?mt=8">更新</a>
window.open('itms-apps://itunes.apple/cn/app/jie-zou-da-shi/id493901993?mt=8');

3.应用内直接跳转到appstore,需要添加StoreKit,framework系统库,需要实现下面的代理方法

SKStoreProductViewController *storeProductViewContorller = [[SKStoreProductViewControlleralloc] init];
//设置代理请求为当前控制器本身
storeProductViewContorller.delegate = self;
//加载一个新的视图展示
[storeProductViewContorller loadProductWithParameters:
 //appId唯一的
 @{SKStoreProductParameterITunesItemIdentifier : @"1049660516"} completionBlock:^(BOOL result, NSError *error) {
     //block回调
     if(error){
         NSLog(@"error %@ with userInfo %@",error,[error userInfo]);
     }else{
         //模态弹出appstore
         [self presentViewController:storeProductViewContorller animated:YES completion:^{

         }
          ];
     }
 }]

//取消按钮监听
- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController{
    [self dismissViewControllerAnimated:YES completion:^{

    }];
}

2016/11/17
补充:跳转到评价页面:

int appID = 1118301512;
    NSString *str = [NSString stringWithFormat:@"http://itunes.apple/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=%d&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8",appID];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];

本文标签: 跳转到详情页面iosAppStore