0

I'm making an app that tracks user location. The idea is when a user reaches certain destination, user's iPhone will vibrate and notification will appear on the screen. I also want to keep app running in background when user locks his phone. So the questions are:

  1. How to keep an app to run in background?
  2. How to send a notification with vibration feedback?
Alexey Savchenko
  • 842
  • 2
  • 10
  • 31
  • Check : 1. http://stackoverflow.com/questions/4724980/making-the-iphone-vibrate 2. http://stackoverflow.com/questions/9319159/local-notification-vibrate-until-user-action 3. http://stackoverflow.com/questions/35276351/make-iphone-vibrate-on-local-notification – Priyal Feb 07 '17 at 12:18
  • 1
    You should use region monitoring using CLRegions. It will allow you to start up the app even if it is terminated. – DatForis Feb 07 '17 at 12:57
  • @DatForis Thanks! I've faced a problem that didEnterRegion is not firing at all, but didDetermineState shows that my location is ".inside" of region. Can you suggest possible solution? – Alexey Savchenko Feb 07 '17 at 17:27
  • Why yes of course, you have to set the `notifyOnEntry` property of the region as true. This will make the method fire once the event happens :) – DatForis Feb 08 '17 at 07:27

1 Answers1

1

You have to implement the Geofencing in your application. You can use raywenderlich demo. Also checkout Apple document for more information.

Application will notify you when you are in region. So you can do whatever you like.

Nirmalsinh Rathod
  • 5,079
  • 4
  • 26
  • 56