一梅肤、在Capabilities選擇Background Modes - >ON,勾選 Location updates
定位后臺(tái)模式設(shè)置.png
二肄梨、 infoPlist設(shè)置定位權(quán)限:
- 允許使用應(yīng)用期間定位:NSLocationWhenInUseUsageDescription
- 始終允許定位: NSLocationAlwaysUsageDescription
infoPlist定位權(quán)限設(shè)置.png
一梅肤、在Capabilities選擇Background Modes - >ON,勾選 Location updates
二肄梨、 infoPlist設(shè)置定位權(quán)限: