How to use UILocalNotification with certain distance?
I am trying to alert user with a notification that if he reaches with a radius say 100m of a certain anno开发者_Python百科tation (i created them) he should receive a notification.
Can any direct me in d right way cause m not able fto find anythng :/.
Thanx alot guys
UILocalNotification
does not have any other means to display them other the the fireDate method.
If you want to tell the user that he is coming close to a specific GPS point you will need to let you app receive location updates when it is in the background.
You can do this by adding Required background modes
mode to the info plist and set it to App registers for location updates
.
Now your app will keep receiving updates in background, this will only work on iPhone 3GS and up.
Then just schedule the UILocalNotification
with a fireDate set as [NSDate date]
and it will fire immediately.
精彩评论