File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,8 @@ + (void) internalGetLocation:(bool)prompt {
160160 locationManager = [[clLocationManagerClass alloc ] init ];
161161 [locationManager setValue: [self sharedInstance ] forKey: @" delegate" ];
162162
163- if ([[[UIDevice currentDevice ] systemVersion ] floatValue ] >= 8.0 ) {
163+ float deviceOSVersion = [[[UIDevice currentDevice ] systemVersion ] floatValue ];
164+ if (deviceOSVersion >= 8.0 ) {
164165
165166 // Check info plist for request descriptions
166167 // LocationAlways > LocationWhenInUse > No entry (Log error)
@@ -169,7 +170,9 @@ + (void) internalGetLocation:(bool)prompt {
169170 NSString * alwaysDescription = [[NSBundle mainBundle ] objectForInfoDictionaryKey: @" NSLocationAlwaysUsageDescription" ];
170171 if (backgroundModes && [backgroundModes containsObject: @" location" ] && alwaysDescription) {
171172 [locationManager performSelector: @selector (requestAlwaysAuthorization )];
172- [locationManager setValue: @YES forKey: @" allowsBackgroundLocationUpdates" ];
173+ if (deviceOSVersion >= 9.0 ) {
174+ [locationManager setValue: @YES forKey: @" allowsBackgroundLocationUpdates" ];
175+ }
173176 }
174177
175178 else if ([[NSBundle mainBundle ] objectForInfoDictionaryKey: @" NSLocationWhenInUseUsageDescription" ])
You can’t perform that action at this time.
0 commit comments