我想在我的应用程序中使用 startMonitoringSignificantLocationChanges,但我有一些问题,希望得到一些帮助:
对于一个普通的应用,如果应用进入后台,10分钟后,系统可以杀死应用。如果我使用startMonitoringSignificantLocationChanges,当我进入后台两个小时,我的应用没有终止,因为我点击图标,应用会进入最后一个退出页面。如果应用程序被杀死,当您单击图标时,您将首先看到默认页面。所以我的问题是使用 startMonitoringSignificantLocationChanges 我的应用程序在进入后台 10 分钟后没有被系统杀死?
如果我关闭手机,然后重新启动手机,当位置发生重大变化时,我的应用程序是否可以激活,我查看苹果开发文档它回答是。所以我测试:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { if([CLLocationManager significantLocationChangeMonitoringAvailable]){ [self log:@"sigAvailable=YES"]; } // Override point for customizatio-n after application launch. id locationValue = [launchOptions objectForKey:UIApplicationLaunchOptionsLocationKey]; if (locationValue) { // create a new manager and start checking for sig changes [self log:@"didFinishLaunchingWithOptions location key"]; m_locManager = [[CLLocationManager alloc] init]; [self log:@"didFinishLaunchingWithOptions created manager"]; m_locManager.delegate = self; [self log:@"didFinishLaunchingWithOptions set delegate"]; [m_locManager startMonitoringSignificantLocationChanges]; [self log:@"didFinishLaunchingWithOptions monitoring sig changes"]; // do send local notification return YES; } [self log:@"didFinishLaunchingWithOptions"]; return YES; }
我的问题:当重新启动移动和本地通知时,运行上面的代码并记录“didFinishLaunchingWithOptions 位置键”等等,如果我在上面的代码中发送本地通知,用户是否会收到?