didEnterRegion works in foreground but not background or other VCs

后端 未结 4 605
夕颜
夕颜 2020-12-16 03:56

If the app is running and the CLLocationManagerDelegate class is the foreground (i.e. visible) then the didEnterRegions triggers and I get both the NSLog as well as the Aler

4条回答
  •  没有蜡笔的小新
    2020-12-16 04:27

    You can post a local notification when you didEnterRegion.

    This will show an alert-like popup even if you're in the background.

    You can do a simple test:

    1) Create a Local notification object inside your applicationDidEnterBackground of your app delegate, with any random message and tell the local notification to fire immediately.

    2) Press the home button, when you app minimise, you should see a popup.

提交回复
热议问题