intuit / LocationManager

Easily get the device's current location on iOS.
MIT License
2.56k stars 387 forks source link

when app is terminated and i don't get launchOptions for "UIApplicationLaunchOptionsLocationKey" it returns null #102

Closed nileshordex closed 6 years ago

nileshordex commented 6 years ago
if ([launchOptions objectForKey:UIApplicationLaunchOptionsLocationKey]) {

                // This "afterResume" flag is just to show that he receiving location updates
                // are actually from the key "UIApplicationLaunchOptionsLocationKey"
                self.shareModel.afterResume = YES;

                [self.shareModel startMonitoringLocation];
                [self.shareModel addResumeLocationToPList];

                self.desiredAccuracy = INTULocationAccuracyRoom;

                //--- App is terminated time Conditional Push Notification

                [self startMonitoringSignificantLocationChanges];

                if ([launchOptions objectForKey:UIApplicationLaunchOptionsLocationKey]) {
                    INTULocationManager *locMgr = [INTULocationManager sharedInstance];

                    [locMgr subscribeToSignificantLocationChangesWithBlock:^(CLLocation *currentLocation, INTULocationAccuracy achievedAccuracy, INTULocationStatus status) {
}];
}
Hitarth2000 commented 5 years ago

What to do if i m getting if ([launchOptions objectForKey:UIApplicationLaunchOptionsLocationKey]) . nil all time ? how to set it in launchOptions ?