iOS Rate App URL Links In MonoGame / Xamarin

So, in the aim of trying to get a simple ‘rate me’ type link working in Floppy Frog I’ve been trawling the Internet and wading through the usual plethora of conflicting information. It really is surprising that such a simple and necessary piece of functionality isn’t better documented or supported by Apple.

Anyway, the best I could come up with is the following (using info from various sources). This should work in pretty much every version of iOS. Seems Apple did something weird with iOS 7 which they then fixed with iOS 7.1.

The ‘id’ parameter is the numeric app id which you can get from iTunes connect. The ‘Purple Software’ parameter in the second URL, whilst it looks like something that should be changed, is actually some weird Apple thing that needs to stay there. Bizarre, I know.

Note that this will NOT work in the iOS Simulator. Hope this helps someone…

using MonoTouch.Foundation;
using MonoTouch.UIKit;

public void RateApp( string id )
{
	String url;
	float iOSVersion = float.Parse(UIDevice.CurrentDevice.SystemVersion);

	if (iOSVersion >= 7.0f && iOSVersion < 7.1f)
	{
		url = "itms-apps://itunes.apple.com/app/id"+id;
	}
	else
	{
		url = "itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id="+id;
	}
	UIApplication.SharedApplication.OpenUrl(new NSUrl(url));
}

And just for some gratuitous search engine bait, here’s some cool Flappy Bird Videos.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: