7

I have implemented Beacon with local notification. Every thing works fine for the case when bluetooth in ON & then device enters the beacon range & app is in "Not running" state. But, when device is already in Beacon range & then Bluetooth is turned ON, no delegate gets called. Is it a limitation or am I missing something?

Pooja M. Bohora
  • 1,311
  • 1
  • 14
  • 42
user928622
  • 185
  • 1
  • 12
  • Why would you expect a call backnin this case? The region state has not changed. – davidgyoung Jul 22 '16 at 11:34
  • Then how would i show Notification for that beacon when user turned on bluetooth in beacon range? – user928622 Jul 25 '16 at 06:24
  • For your scenario where the device is "already in Beacon range & then the Bluetooth is turned ON, no delegate is called" - is this while the app is in a Terminated (force quit) state? – MarioKurt Aug 13 '16 at 16:57
  • need code...in which method application is killed? – Sofeda Aug 14 '16 at 11:35
  • "But, when device is already in Beacon range & then Bluetooth is turned ON, no delegate gets called" do you change you device location at this situation? – Sofeda Aug 14 '16 at 11:39
  • @MarioKurt : Yes app is in a Terminated (force quit) state – user928622 Aug 17 '16 at 06:50
  • @SMi: I didn't change the location at this situation. – user928622 Aug 17 '16 at 06:53
  • Give some code. Which methods you implement from CLLocationManagerDelegate? What is your CLBeaconMajorValue and minor value last time it works? – Sofeda Aug 18 '16 at 10:08

1 Answers1

0

This is a limitation of the Core Location framework.

When an application is terminated "Not Running" state, it can be re-launched due to location manager region didEnter / didExit region events. Your location manager will not receive region enter / exit events if you toggle your Bluetooth on and off while the application is terminated. The only way you'll be able to get didEnter / didExit events to fire is by physically entering or exiting one of your beacon regions by crossing their detection threshold.

  • Terminated apps will wake up on region didEnter / didExit events.

The region monitoring service delivers events normally while an app is running in the foreground or background. (You can use this service for both geographic and beacon regions.) For a terminated iOS app, this service relaunches the app to deliver events.

  • Beacon ranging will not wake up your app.

(If the beacon region’s notifyEntryStateOnDisplay property is true, waking the device causes the app to range for beacons for a few seconds in the background.) This service does not relaunch iOS apps that have been terminated; however, you can be relaunched by monitoring beacon regions using the region monitoring service.

MarioKurt
  • 300
  • 1
  • 5