• app 评分


    #pragma mark -- app store

    - (void)jumpToAppStore{

        

     

          NSString *evaluateString = [NSString stringWithFormat:@"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=517198355&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8" ];

        

        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:evaluateString]];

     

        

    }

     

    #pragma mark -- 应用内

    //苹果提供了一个框架StoreKit.framework,

    //导入StoreKit.framework,在需要跳转的控制器里面添加头文件 #import,

    //实现代理方法:< SKStorePRoductViewControllerDelegate >

    - (void)loadAppStoreController

    {

        

        //初始化控制器

        SKStoreProductViewController *storeProductViewContorller = [[SKStoreProductViewController alloc] init];

        //设置代理请求为当前控制器本身

        storeProductViewContorller.delegate = self;

        //加载一个新的视图展示

        [storeProductViewContorller loadProductWithParameters:

         //appId唯一的

         @{SKStoreProductParameterITunesItemIdentifier : @"517198355"} 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:^{

                    

                }];

                

            }

     

  • 相关阅读:
    Python_报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 0: illegal multibyte sequence
    Python_报错:TypeError: file must have 'read' and 'readline' attributes
    Maven不扫描java文件夹下的配置文件解决办法
    Web中的相对路径和绝对路径
    sqlyog报错2058
    base标签的作用
    相对路径和绝对路径的解释
    自定义Tomcat部署目录
    常用正则表达式
    接口的结构定义
  • 原文地址:https://www.cnblogs.com/daxueshan/p/6060883.html
Copyright © 2020-2023  润新知