diff options
Diffstat (limited to 'platform/ios/src/MGLSDKUpdateChecker.mm')
-rw-r--r-- | platform/ios/src/MGLSDKUpdateChecker.mm | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/platform/ios/src/MGLSDKUpdateChecker.mm b/platform/ios/src/MGLSDKUpdateChecker.mm deleted file mode 100644 index cfea139bdb..0000000000 --- a/platform/ios/src/MGLSDKUpdateChecker.mm +++ /dev/null @@ -1,37 +0,0 @@ -#import "MGLSDKUpdateChecker.h" -#import "NSBundle+MGLAdditions.h" - -@implementation MGLSDKUpdateChecker - -+ (void)checkForUpdates { -#if TARGET_IPHONE_SIMULATOR - // Abort if running in a playground. - if ([[NSBundle mainBundle].bundleIdentifier hasPrefix:@"com.apple.dt.playground."]) { - return; - } - - NSString *currentVersion = [NSBundle mgl_frameworkInfoDictionary][@"MGLSemanticVersionString"]; - - // Skip version check if weʼre doing gl-native development, as the framework - // version is `1` until built for packaging. - if ([currentVersion isEqualToString:@"1.0.0"]) { - return; - } - - NSURL *url = [NSURL URLWithString:@"https://docs.mapbox.com/ios/maps/latest_version.txt"]; - [[NSURLSession.sharedSession dataTaskWithURL:url completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { - if (error || ((NSHTTPURLResponse *)response).statusCode != 200) { - return; - } - - NSString *latestVersion = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - latestVersion = [latestVersion stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; - if (![currentVersion isEqualToString:latestVersion]) { - NSString *updateAvailable = [NSString stringWithFormat:NSLocalizedStringWithDefaultValue(@"SDK_UPDATE_AVAILABLE", nil, nil, @"Mapbox Maps SDK for iOS version %@ is now available:", @"Developer-only SDK update notification; {latest version, in format x.x.x}"), latestVersion]; - NSLog(@"%@ https://github.com/mapbox/mapbox-gl-native/releases/tag/ios-v%@", updateAvailable, latestVersion); - } - }] resume]; -#endif -} - -@end |