0

I've been trying to direct users to the app store (iTunes) to rate my app. I can't get the right link. Users say that when they click the button, nothing happens.

This is the current link I'm using:

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

And in my code, which is for Adobe AIR, this is the line:

navigateToURL(new URLRequest("tms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=XXXXX"));

(Of course XXXXX is replaced with my App ID).

Appreciate any help. Thanks.

Koby Douek
  • 16,156
  • 19
  • 74
  • 103
  • I guess it's the `tms-apps` protocol. There is [another question](http://stackoverflow.com/questions/3374050/url-for-sending-a-user-to-the-app-review-page-on-devices-app-store) about review linking and the [first answer](http://stackoverflow.com/a/3374268/1456318) provides some alternatives. It's a rather old question but perhaps it's still valid. – michaPau May 19 '16 at 15:52

1 Answers1

0

This is core objective-c code. Its very self-explanatory. All you need to do is to check whether the device is running iOS 7 or prior. In iOS 7, the URL for rating page is different.

URL Format for iOS 7 or prior: itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=XXXXXXX

URL Format for above iOS 7: itms-apps://itunes.apple.com/app/idXXXXXX

In Objective-C, it looks like this:

NSString *cAppleID = @"YOUR_APP_ID";
NSString* iOS7AppStoreURLFormat = @"itms-apps://itunes.apple.com/app/id%@";
NSString* iOSAppStoreURLFormat = @"itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@";
NSString* url = [[NSString alloc] initWithFormat: ([[UIDevice currentDevice].systemVersion floatValue] >= 7.0f) ? iOS7AppStoreURLFormat : iOSAppStoreURLFormat, cAppleID];
[[UIApplication sharedApplication] openURL: [NSURL URLWithString: url]];

In AS3, it would look more like this (iOSVersion getter from How to determine the IOS version from within an Flex mobile app (AIR)):

//Put in a Utils class
public static function get iOSVersion():uint {
    var iosVersion:String = Capabilities.os.match( /([0-9]\.?){2,3}/ )[0];
    return Number( iosVersion.substr( 0, iosVersion.indexOf( "." ) ) );
}



var osVersion:Number = Utils.iOSVersion;
var url:String;
if (osVersion >= 7.0) {
    url = "itms-apps://itunes.apple.com/app/idXXXXXX";
} else {
    url = "itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=XXXXXXX";
}

navigateToURL(new URLRequest(url));
Community
  • 1
  • 1
Nirav
  • 119
  • 7
  • What is this ? Please add some description, and is this even AS3 ? – Koby Douek May 19 '16 at 07:52
  • delete this unrelated answer to a AS3 question. – BotMaster May 19 '16 at 12:29
  • @BotMaster I disagree. This answers the question perfectly; it details the required URL format, depending on iOS version, and it's plain to see that the format shown in the question doesn't match the format in this answer. The Objective-C code is really just a distraction from that. – Brian May 19 '16 at 17:44
  • @Brian good edit, I noticed the Objective-C code uses `initWithFormat` and the final URL includes that `cAppleID`. I think it's a URL variable for POST operation? Will that matter if not mentioned in AS3 version URL? Don't have enough server / iTunes experience but I wonder if leaving it will put a stop to progress... – VC.One May 19 '16 at 20:56
  • @VC.One `initWithFormat` just substitutes in `cAppleID` for `%@` in whichever `_AppStoreURLFormat` variable is used. It's the more idiomatic way of including the apple ID vs. typing it separately in each string literal. – Brian May 20 '16 at 15:28