Permalink
Browse files

Use @Aranda's code for marketplace on iOS

  • Loading branch information...
1 parent e780d76 commit b797bca69d0bd0dd14d7c4864318a93a9eeeb483 @Nezz Nezz committed Feb 12, 2013
Showing with 16 additions and 4 deletions.
  1. +16 −4 MonoGame.Framework/iOS/GamerServices/Guide.cs
@@ -336,11 +336,23 @@ public static Nullable<int> EndShowMessageBox (IAsyncResult result)
public static void ShowMarketplace (PlayerIndex player)
{
- AssertInitialised ();
+ AssertInitialised();
+
+ string bundleName = NSBundle.MainBundle.InfoDictionary[new NSString("CFBundleName")].ToString();
+ StringBuilder output = new StringBuilder();
+ foreach (char c in input)
+ {
+ // Ampersand gets converted to "and"!!
+ if (c == '&')
+ output.Append("and");
- // TODO: Add your own link
- NSUrl url = new NSUrl("http://www.monogame.net");
- if (!UIApplication.SharedApplication.OpenUrl(url)) {
+ // All alphanumeric characters are added
+ if (char.IsLetterOrDigit(c))
+ output.Append(c);
+ }
+ NSUrl url = new NSUrl("itms-apps://itunes.com/app/" + output.ToString());
+ if (!UIApplication.SharedApplication.OpenUrl(url))
+ {
// Error
}
}

0 comments on commit b797bca

Please sign in to comment.