zoukankan      html  css  js  c++  java
  • 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:^{

                    

                }];

                

            }

     

  • 相关阅读:
    原创:【微信小程序】发送消息模板教程(后台以PHP示例)
    【微信小程序】详解wx:if elif else的用法(搭配view、block)
    原创:微信小程序+WEB使用JS实现注册【60s】倒计时功能
    微信小程序的POST和GET请求方式的header区别
    什么是单例模式
    Spring bean的生命周期
    对Spring Bean了解一二
    匿名内部类了解一二
    Eclipse中如何查看使用的JDK版本
    什么是语法糖
  • 原文地址:https://www.cnblogs.com/daxueshan/p/6060883.html
Copyright © 2011-2022 走看看