2013-10-25 67 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遠離我的應用程序。 –

相關問題