iOS 激活APP时通知APP开始获取用户位置

xiaoxiao2021-02-27  403

//添加激活APP定位通知 [self addNotiLocation]; - (void)addNotiLocation { UIApplication *application = [UIApplication sharedApplication]; [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(applicationDidBecomeActive:) name:EnterForeground object:application]; [[NSNotificationCenter defaultCenter]postNotificationName:EnterForeground object:nil]; } - (void)applicationDidBecomeActive:(NSNotification *)notification { [self requestCurrentLocationOnce]; }
转载请注明原文地址: https://www.6miu.com/read-2488.html

最新回复(0)