Swift -- appStore評分

  • 應(yīng)用外跳轉(zhuǎn)
UIApplication.shared.openURL(URL(string: "http://itunes.apple.com/cn/app/wechat/id836500024?mt=12")!)
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://itunes.apple.com/cn/app/wechat/id836500024?mt=12"]];  
  • 應(yīng)用內(nèi)跳轉(zhuǎn)
private func jumpStoreScore() {
   let storeCtrlr = SKStoreProductViewController()
   storeCtrlr.delegate = self
   storeCtrlr.loadProduct(withParameters: [SKStoreProductParameterITunesItemIdentifier: "836500024"]) { [weak self] (isSuccess, error) in
       if isSuccess {
           self?.present(storeCtrlr, animated: true, completion: {
           })
       }else {
           print("error:\(String(describing: error))")
       }
   }
}
func productViewControllerDidFinish(_ viewController: SKStoreProductViewController) {
        dismiss(animated: true) { 
            print("取消 productViewControllerDidFinish")
        }
}
- (void)jumpStoreScore {
    SKStoreProductViewController *storeProductViewContorller = [[SKStoreProductViewController alloc] init];
    storeProductViewContorller.delegate=self;
    [storeProductViewContorller loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier:@"836500024"} completionBlock:^(BOOLresult,NSError*error) {
        if(error) {
            NSLog(@"error %@ with userInfo %@",error,[erroruserInfo]);
        }else{
            [self presentViewController: storeProductViewContorller animated:YES completion: nil];
        }
    }];
}

//AppStore取消按鈕監(jiān)聽
- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController {
    [self dismissViewControllerAnimated:YES completion:nil];
}

使用應(yīng)用外的方式可以實(shí)現(xiàn)進(jìn)入AppStore頁面
使用應(yīng)用外跳轉(zhuǎn)就是調(diào)不起來,提示:

2017-06-21 16:23:26.787090+0800 xxxx[3308:202712] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/xx/Library/Developer/CoreSimulator/Devices/17CBA861-06CE-40AF-BDDF-88A5A087AF04/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2017-06-21 16:23:26.788148+0800 xxxx[3308:202712] [MC] Reading from private effective user settings.

好像也沒什么權(quán)限問題設(shè)置的,調(diào)不起來也不知道咋回事。。先放著吧,要用的時候在調(diào)

參考:iOS 應(yīng)用跳轉(zhuǎn)到AppStore評分 可內(nèi)置跳轉(zhuǎn)

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Android 自定義View的各種姿勢1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 179,174評論 25 708
  • 發(fā)現(xiàn) 關(guān)注 消息 iOS 第三方庫、插件、知名博客總結(jié) 作者大灰狼的小綿羊哥哥關(guān)注 2017.06.26 09:4...
    肇東周閱讀 15,426評論 4 61
  • ⒏推理 “事情怎么樣了?” “起初很成功,但是后來出現(xiàn)了一個叫林曉峰的人,他很聰明,識...
    葉凌凡閱讀 470評論 0 3
  • 我的鄰居尚姨是個非常熱心的老太太,一共生了兩個兒子和三個女兒,唐山大地震時老伴和一個老閨女遇難…… 那個年代孩子多...
    海迪哲lshj閱讀 307評論 2 2

友情鏈接更多精彩內(nèi)容