Permalink
Browse files

Merge pull request #5 from BrokenGlass/master

fixes for iOS 7
  • Loading branch information...
2 parents 245d572 + ca79504 commit 4816ad956f1d6be0ffb6d34ff36ad96ab9fff193 @chebum committed Aug 4, 2014
Showing with 9 additions and 3 deletions.
  1. +9 −3 Appirater.cs
View
@@ -115,8 +115,8 @@ public AppiraterSettings (int appId, string appName, bool debug)
public class Appirater : NSObject
{
- const string SELECTOR_INCREMENT_AND_RATE = "incrementAndRate";
- const string SELECTOR_INCREMENT_EVENT_AND_RATE = "incrementSignificantEventAndRate";
+ const string SELECTOR_INCREMENT_AND_RATE = "incrementAndRate:";
+ const string SELECTOR_INCREMENT_EVENT_AND_RATE = "incrementSignificantEventAndRate:";
const string FIRST_USE_DATE = "kAppiraterFirstUseDate";
const string USE_COUNT = "kAppiraterUseCount";
const string SIGNIFICANT_EVENT_COUNT = "kAppiraterSignificantEventCount";
@@ -125,6 +125,7 @@ public class Appirater : NSObject
const string DECLINED_TO_RATE = "kAppiraterDeclinedToRate";
const string REMINDER_REQUEST_DATE = "kAppiraterReminderRequestDate";
const string TEMPLATE_REVIEW_URL = "itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id={0}";
+ const string TEMPLATE_REVIEW_URL_IOS7 = @"itms-apps://itunes.apple.com/{0}/app/id{1}";
readonly AppiraterSettings settings;
UIAlertView ratingAlert;
@@ -241,6 +242,11 @@ public void RateApp ()
else {
NSUserDefaults userDefaults = NSUserDefaults.StandardUserDefaults;
string reviewURL = string.Format (TEMPLATE_REVIEW_URL, settings.AppId);
+ int systemMajorVersion = Convert.ToInt16 (UIDevice.CurrentDevice.SystemVersion.Split ('.') [0].ToString ());
+ if (systemMajorVersion >= 7)
+ {
+ reviewURL = string.Format (TEMPLATE_REVIEW_URL_IOS7, NSLocale.PreferredLanguages [0], settings.AppId);
+ }
userDefaults.SetBool (true, RATED_CURRENT_VERSION);
userDefaults.Synchronize ();
UIApplication.SharedApplication.OpenUrl (NSUrl.FromString (reviewURL));
@@ -456,4 +462,4 @@ public override void Clicked (UIAlertView alertview, int buttonIndex)
}
}
}
-}
+}

0 comments on commit 4816ad9

Please sign in to comment.