Bathilde Rocchia Bathilde Rocchia - 3 months ago 14
Objective-C Question

UILocalNotification from previous install in ios9 (with CLLocationManager)

I have created a very simple app that use

CLLocationManager
with
CLBeaconRegion
.
When the application is in background and the user
enters/exits
a region, it creates a corresponding notification ("Welcome"/"Goodbye").

The project works fine, except I keep receiving old notifications from previous installation when the user
enters/exits
region.

"
monitoredRegions
" inside
CLLocationManager
only contains the current one.

local notifications are send through "
presentLocalNotificationNow
".

If you have any idea how I can receive only the notifications from the current installation..

Answer

I found why I do not receive the correct notification at the right time. Once a region is added to the UILocalNotification, the notification is not send right after a call to presentLocalNotificationNow