在iOS应用中直接跳转到AppStore的方法

// 1. 登录iTunes Connect,在‘App信息’中的‘额外信息’选项中点击’在AppStore中查看‘
//    通过打开的url找到应用程序的描述链接,比如:https://itunes.apple.com/us/app/yi-yuan-dian/id1106335106?l=zh&ls=1&mt=8

// 2. 代码如下:

- (void)showAppUpgradeView
{
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"版本更新" message:@"发现新版本,立即前往App Store下载吧" delegate:self cancelButtonTitle:@"暂不更新" otherButtonTitles:@"前往下载", nil];
    [alertView show];
}

#pragma mark - UIAlertViewDelegate
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if (alertView.cancelButtonIndex == buttonIndex) {
        return;
    }

    // appStoreUrl是第一步拿到的app描述链接
    NSString *appStoreUrl = @"https://itunes.apple.com/us/app/yi-yuan-dian/id1106335106?l=zh&ls=1&mt=8"; 
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:appStoreUrl]];

}



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值