dlangley / TheBackgrounder3

RayWenderlich's Tut transposed into Swift 3 in Xcode 8 for iOS 10
0 stars 0 forks source link

location update does not work in background #1

Open ritesh124 opened 7 years ago

ritesh124 commented 7 years ago

Hi Sir, I am using Xcode 9 and iOS 11. Other things like background music and NStimer works fine in background But when it comes to mapKit. it does not work. I am trying to make a running tracker app. The user has to run at least 1 kilometer to update server. Moreover in LocationViewController.swift fine line number 89 executes only once or twice. But I want it to be running for at least 10 to 12 minutes. I am using the simulator. Also Is there a way to check the timer for 10 to 12 minutes as the user can take this much time to cover 1 kilometer of distance.

dlangley commented 7 years ago

It sounds like it would be better for you to implement the Significant Change Service.

For details, refer to the Programming Guide for Tracking the User’s Location and Starting the Significant-Change Location Service.

And you'll probably want to use the callback allowDeferredLocationUpdatesUntilTraveled:timeout: either way.

Hope that was helpful.