From ca79504d38f4e6e98f44e67f9954d757ae8e918d Mon Sep 17 00:00:00 2001 From: BrokenGlass Date: Sun, 3 Aug 2014 17:41:18 -0400 Subject: [PATCH] fixes for iOS 7 fixes for iOS 7 - fix selector export names - fix review URL for iOS 7.x (old one leads to a blank page) --- Appirater.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Appirater.cs b/Appirater.cs index a4e0e3f..e68de1b 100644 --- a/Appirater.cs +++ b/Appirater.cs @@ -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) } } } -} \ No newline at end of file +}