2013-10-25 66 views
1

我听说iOS7允许用户对该应用中的应用进行评分和评审,避免了重定向到appstore和离开应用的需要。到目前为止,我只在ITunes review URL and iOS 7 (ask user to rate our app) AppStore show a blank page中提到的iTunes中的速率功能的URL链接中找到了区别,但不知道如何留在应用程序中。评分和评论可能在iOS7的应用程序?

我在我的应用程序中使用Appirater,并集成了新的网址和应用程序转到appstore的费率/审查。

有人可以告诉我,这个新功能是否存在以及如何实现它?

回答

4

我想你正在寻找SKProductViewController。

就能呈现SKProductViewController用下面的代码:

NSDictionary *parameters = [NSDictionary dictionaryWithObject:@"YOURITUNESAPPID" forKey:SKStoreProductParameterITunesItemIdentifier]; 

SKProductViewController *productViewController = [[SKProductViewController alloc] init]; 
[self presentViewController:productViewController animated:YES completion:nil]]; 

这是假设你是在一个UIViewController子类,知道你的iTunes应用程序标识符。这将显示一个模型viewController,显示该应用程序的AppStore条目。

用户可以从该viewController发出评级。尽管未能撰写评论。

+0

工作就像一个魅力。谢谢!! –

+2

这是行不通的,苹果已禁用在iOS 7中使用“SKProductViewController”来查看应用程序的可能性。 – mattsson

+1

您没有在示例 – Sunkas

2

我使用Appirater有同样的问题,我已经部分解决了proplem这样

定义模板iOS7:

NSString *templateReviewURLiOS7 = @"itms-apps://itunes.apple.com/app/idAPP_ID";

使这个chnges在rateApp方法

+ (void)rateApp { 

    . 
    . 
    . 

// this URL Scheme should work in the iOS 6 App Store in addition to older stores 
NSString *reviewURL = [templateReviewURL stringByReplacingOccurrencesOfString:@"APP_ID" withString:[NSString stringWithFormat:@"%@", _appId]]; 

    // iOS 7 needs a different templateReviewURL @see https://github.com/arashpayan/appirater/issues/131 
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { 
     reviewURL = [templateReviewURLiOS7 stringByReplacingOccurrencesOfString:@"APP_ID" withString:[NSString stringWithFormat:@"%@", _appId]]; 
    } 

    . 
    . 
    . 
} 

这将在iOS6中打开与以前相同的价格页面,并在iOS7中打开应用页面

+0

我也这样做了,但是这又把我带到appstore远离我的应用程序。 –

相关问题