开发者

Link to iTunes Ratings Page

What's the link to the ratings page on iTunes for my app?

[[UIApplicati开发者_高级运维on sharedApplication] openURL:[NSURL URLWithString:@"???"]];


This other question has an appropriate answer. Note that the type=Purple+Software part is literal and not the name of your company. The only thing you need to change is the app id. This example is a little strange in that the string is broken up into several strings, I would just use one for the format to substitute the app id.

The end result looks like this:

itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=123456789


after iOS7 @Jon Steinmetz link deprecated. so, you should write a code divide os version as follows.

if([[UIDevice currentDevice] systemVersion].floatValue >= 7.0f)
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://itunes.apple.com/app/id%@", #YourAppID#]]];
else
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=%@&pageNumber=0&sortOrdering=1&type=Purple+Software&mt=8", #YourAppID#]]];


Creating a rating link could become a complex issue when supporting multiple OS and multiple platform. For example the WebObjects isn't supported on iOS 7 (some of them), some links you create would open another country store then the user's etc.

There are 2 related open source libraries that could help you:

  1. iLink - There the link would be found at run time (the library would check the app ID and the OS it is running on and would figure out what link should be created). The best point in this is that you don't need to configure nothing before using it so that is error free and would work always. That's great also if you have few targets on same project so you don't have to remember which app ID or link to use. This library also would prompt the user to upgrade the app if there is a new version on the store (this is built in and you turn this off by a simple flag).

    Copy the 2 library files to your project.

    On your appDelegate.m:

    #import "iLink.h"
    
    + (void)initialize
    {
        //configure iLink
        [iLink sharedInstance].globalPromptForUpdate = YES; // If you want iLink to prompt user to update when the app is old.
    }
    

    and on the place you want to open the rating page for example just use:

    [[iLink sharedInstance] openRatingsPageInAppStore];
    

    and import iLink.h on the same file.

    There is a very good doc for the whole library there and an example projects for iPhone and for Mac.

  2. iRate - This library is super recommended if you want the library to prompt the user rating process automatically. Just set the parameters you want and it would do the work for you (also have translations for lots of languages). The downside is that you would use an alert view for that and not your own UI.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜