startUpdatingLocation of LocationManager through silent push notification

后端 未结 4 999
南笙
南笙 2021-02-04 22:39

I am creating app that needs to wake up in background at particular time .

I have tried :

  1. UILocalNotification : But i Don\'t want to use UILoca

4条回答
  •  滥情空心
    2021-02-04 23:26

    If you want to update location in background mode, you just enable UIBackgroundModes in plist file. See startUpdatingLocation description in apple's doc..

    If you start this service and your application is suspended, the system stops the delivery of events until your application starts running again (either in the foreground or background). If your application is terminated, the delivery of new location events stops altogether. Therefore, if your application needs to receive location events while in the background, it must include the UIBackgroundModes key (with the location value) in its Info.plist file.

    You can enable this for background updation in your xcode5+ as like below..

    enter image description here

提交回复
热议问题