Grey GPS arrow shown in statusbar although location based application killed using Fast App Switcher

て烟熏妆下的殇ゞ 提交于 2019-12-01 08:20:28
  1. Significant Location updates are available if you app is not in foreground.
  2. I just give you an idea I have done something like this but I don't know what happens in your case.
    Just register your app for background task and do some thing for testing purpose in that case if you kill your app via fast app switching then the delegate method applicationWillTerminate: is always called.


___________Edited______________
just add this varibale into your AppDelegate.h

UIBackgroundTaskIdentifier bgTask;

and make your delegate method like this and now kill your app

    - (void)applicationDidEnterBackground:(UIApplication *)application
    {
        UIApplication *app = [UIApplication sharedApplication];
        if ([app respondsToSelector:@selector(beginBackgroundTaskWithExpirationHandler:)]) {
            bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
                // Synchronize the cleanup call on the main thread in case
                // the task actually finishes at around the same time.
                dispatch_async(dispatch_get_main_queue(), ^{
                    if (bgTask != UIBackgroundTaskInvalid)
                    {
                        [app endBackgroundTask:bgTask];
                        bgTask = UIBackgroundTaskInvalid;
                    }
                });
            }];
        }
    }

- (void)applicationWillTerminate:(UIApplication *)application
{
    NSLog(@"is terminated");
}


_____________________________

try to restore the "location warnings" in "settings->general->reset->reset location warnings". It worked for me using "startupdatinglocation".

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!