From c12c1106dcef301bfeaa8c4a06be017d8c2c90d9 Mon Sep 17 00:00:00 2001 From: Arthur Ariel Sabintsev Date: Tue, 19 Jul 2016 11:12:17 -0500 Subject: [PATCH] appID is now being properly set --- Harpy/Harpy.m | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Harpy/Harpy.m b/Harpy/Harpy.m index 5e61de9..0e47bf8 100755 --- a/Harpy/Harpy.m +++ b/Harpy/Harpy.m @@ -249,9 +249,15 @@ - (BOOL)isAppStoreVersionNewer:(NSString *)currentAppStoreVersion { } - (void)appStoreVersionIsNewer:(NSString *)currentAppStoreVersion { - [self localizeAlertStringsForCurrentAppStoreVersion:currentAppStoreVersion]; - [self alertTypeForVersion:currentAppStoreVersion]; - [self showAlertIfCurrentAppStoreVersionNotSkipped:currentAppStoreVersion]; + _appID = _appData[@"results"][0][@"trackId"]; + + if (_appID == nil) { + [self printDebugMessage:@"appID is nil, which means to the trackId key is missing from the JSON results that Apple returned for your bundleID. If a version of your app is in the store and you are seeing this message, please open up an issue http://github.com/ArtSabintsev/Harpy and provide as much detail about your app as you can. Thanks!"]; + } else { + [self localizeAlertStringsForCurrentAppStoreVersion:currentAppStoreVersion]; + [self alertTypeForVersion:currentAppStoreVersion]; + [self showAlertIfCurrentAppStoreVersionNotSkipped:currentAppStoreVersion]; + } } - (void)launchAppStore {