summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin R. Miller <incanus@codesorcery.net>2015-03-26 22:37:31 -0700
committerJustin R. Miller <incanus@codesorcery.net>2015-03-26 22:37:31 -0700
commit0350216d3437471bc5c1a937c734ef0c3d05307c (patch)
tree3019c9e0144b98c5570f1bf3662350379306d12f
parent83f083c7b5854db25168240a4ad7a313f2765f05 (diff)
parente42dab756cd86042afea2f883e5f465e202ca694 (diff)
downloadqtlocation-mapboxgl-0350216d3437471bc5c1a937c734ef0c3d05307c.tar.gz
Merge remote-tracking branch 'origin/master' into metrics-stability-squash
-rw-r--r--platform/ios/MGLMapboxEvents.m13
1 files changed, 12 insertions, 1 deletions
diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m
index 7fded59f3e..5ecbbb6d2b 100644
--- a/platform/ios/MGLMapboxEvents.m
+++ b/platform/ios/MGLMapboxEvents.m
@@ -575,7 +575,18 @@ NSString *const MGLEventMapLocation = @"Location";
__block BOOL result;
BOOL (^pushCheckBlock)(void) = ^{
- return [[UIApplication sharedApplication] isRegisteredForRemoteNotifications];
+ if ([[UIApplication sharedApplication] respondsToSelector:@selector(isRegisteredForRemoteNotifications)]) {
+ // iOS 8+
+ result = [[UIApplication sharedApplication] isRegisteredForRemoteNotifications];
+ } else {
+ // iOS 7
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
+ result = (types == UIRemoteNotificationTypeNone) ? NO : YES;
+#pragma clang diagnostic pop
+ }
+ return result;
};
if ( ! [[NSThread currentThread] isMainThread]) {