码迷,mamicode.com
首页 > 移动开发 > 详细

iOS app内评分

时间:2015-05-15 17:39:13      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:

 

app内评分

  导入依赖的框架

  #import <StoreKit/StoreKit.h>

 

  

// app内评分
- (void)presentStoreProductVC
{
    
    SKStoreProductViewController *storeProductViewContorller = [[SKStoreProductViewController alloc] init];
    
    storeProductViewContorller.delegate = self;
    
    [storeProductViewContorller loadProductWithParameters:
     
     @{SKStoreProductParameterITunesItemIdentifier:@"xxxxxxxxx"} completionBlock:^(BOOL result, NSError *error) {
         
         if(error){
             NSLog(@"error %@ with userInfo %@",error,[error userInfo]);
         }else{
             
             [self presentViewController:storeProductViewContorller animated:YES completion:nil];
         }
     }];
}

#pragma mark - SKStoreProductViewControllerDelegate
- (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

 

  

iOS app内评分

标签:

原文地址:http://www.cnblogs.com/airy99/p/4506367.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!