loup-v / beacons

Flutter beacons plugin for Android and iOS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not detecting changes when app is killed (iOS)

AndrewPetrovics opened this issue · comments

After killing the app we're are not getting any notifications when we enter and exit regions on iOS.

I suspect it's because the notifyEntryStateOnDisplay is not getting set to true by default.

To recreate, monitor a region and write a value to database each time enter and exit region, kill the app, enter/exit region => no change detected in database.

@AndrewPetrovics Should be fixed in 0.1.1.
Be sure to call inBackground: true to enable the background support.

So, this definitely helped, but still not able to able to detect entering/exiting regions when the app is killed (completely terminated by the user).

I can confirm that the app is indeed being waken up, but code doesn't seem to be executing and I'm not sure how to debug further with xCode.

Have you been able to detect enter/exit when app is completely killed?

Not sure if I'm doing something wrong.

Also, we did add the appropriate capabilities (Background Mode - 'Location updates' and Background Mode - 'Uses Bluetooth LE accessories').

Please check version 0.1.2 (+ updated changelog and example project).
Background support is a bit tricky, with lots of constraints to get a background callback on the Flutter side, but it should work now.
Let me know, thanks.

Actually version 0.2.0.

I updated the readme with more detailed explanation on how background monitoring work.

Still no dice unfortunately.

The furthest I can get with debugging is attaching the process with xCode and setting a breakpoint at didFinishLaunchingWithOptions confirming the app does indeed launch in the background.

However, the following error is generated...

libGPUSupportMercury.dylibgpus_ReturnNotPermittedKillClient:`

Any thoughts?

Can you try with the example project?
The project shows a local notification from the Flutter side when a monitoring event is triggered from background.

The steps:

  1. Run the application on the device through xcode
  2. Go to monitoring tab, and tap the "start" button
  3. Trigger enter region (using real beacon or beacon simulator app) => check the logs on xcode console in order to confirm it works (by default, the plugin prints logs for monitoring events)
  4. Trigger exit region (using real beacon or beacon simulator app) => check the logs on xcode console in order to confirm it works (by default, the plugin prints logs for monitoring events). In my tests, I have to wait ~20/30s before receiving an exit region event from iOS.
  5. Terminate the app using iOS multitask (don't terminate the app through xcode stop button)
  6. Trigger enter region (using real beacon or beacon simulator app)
  7. After few seconds, the app should display a local notification with the associated event (because the app was killed, there are no logs available on xcode console)

Using these steps, I can see the local notification on several devices (latest iOS version): iphone 6, iphone 7, and iphone 8 plus.

Ok, we got it working with the local notifications, but still experiencing a few issues that we are still testing out.

Will keep you posted.

Great! Let me know if I can help.

Please reopen if necessary.