Skip to content

Commit

Permalink
Use @Aranda's code for marketplace on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Nezz authored and tomspilman committed Feb 25, 2013
1 parent 04b460f commit 638eef9
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions MonoGame.Framework/iOS/GamerServices/Guide.cs
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,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
}
}
Expand Down

0 comments on commit 638eef9

Please sign in to comment.