Open JoeyBodnar opened 5 years ago
Here is a gist I made of my code: https://gist.github.com/JoeyBodnar/aaf291271d86ff5aaff80282e9f858a1
Also, under "Capabilities" I have both "Location updates" and "Uses Bluetooth LE Accessories" checked:
Hi @JoeyBodnar,
In the background, to get the beacon notification again, you should move away from the beacon region. We don't want to the user to get repeated notifications.
In the foreground we send you list of beacons found nearby.
Were you still in the beacon region?
Yes, I will mention this to Ryan. Thank you.
He said that even if he turned on a different beacon, it would not detect it. For example:
1) turn on beacon 1 2) set app in background 3) app detects beacon 4) wait a few hours 5) turn on beacon 2 6) beacon 2 is not detected in the background 7) opening the app immediately detects beacon 2
is this expected behavior?
Also, if the app is force-closed, should it still be detecting beacons? or does it have to be open in the background to do so?
Have you experienced this behavior before?
Hi @JoeyBodnar,
The app requires Always Allow location permission so that it can display the notification when the app is killed. As it will be woken up in the background based on beacon region events.
There are certain restrictions on waking the app in the background. You mentioned to wait for few hours. The OS may have killed the app, please confirm if it isn't the case.
Once the app is killed we are relying on the beacon region events to scan and show the notifications.
yes, I was told that the OS did kill the app, as it was awake in the background before at night, and the following morning the app was killed.
Would you be willing to download our app via TestFlight and see if you can verify that it is operating correctly?
Hi @JoeyBodnar, NearBee framework depends on EddystoneScanner SDK. I have fixed bluetooth state bug in the EddystoneScanner which sometimes caused the NearBee SDK not to trigger the scanning.
Can you please update it to 1.2.10 and see if it adversely affected your test cases?
After this, if you need further assistance please drop a mail to support@beaconstac.com and we can schedule a call to go through your use cases.
yes indeed, I will update and continue testing. Thanks!
So the problem is not 100% resolved. Here is all beacon related code in my app, from the info.plist, to App Delegate, to the view controller. I should note, the View Controller where we detect beacons is NOT the first root View Controller in the app, it is the second and appears after another view controller appears.
code: https://gist.github.com/JoeyBodnar/a0b06e306ada899ff2aca318360a6940
Is there anything in there that looks like it is not correct or could cause a potential problem?
@sachinmobstac
@sachinmobstac does anyone have any comment on this?
@JoeyBodnar Apologies, the person in charge of this is no more at the company. I am going to have someone else look at your code next week.
Ok thank you.
Is there any update on this? I was told 2 weeks ago that someone would look at the code last week, and then again that someone would look at it this week. it's already Thursday and just wanted to make sure it could get done this week, thank you.
@JoeyBodnar We checked the code and the function viewDidLoad() is not where the NearBee initialisation should be. Please move the relevant code to the didFinishLaunchingWithOptions method in the app delegate.
@JoeyBodnar Specifically, the nearBee.enableBackgroundNotifications(true) should be there.
alright thank you! I will change the code and test it again.
I put the initialization code in the didFinishLaunchingWithOptions in the AppDelegate but am still experiencing the problem where the app receives beacon notifications on first install, but never again after that.
Ryan said that there was a sample app that he tested that you all let him use and that it worked correctly. Could I see the code for that sample app so I can try to mimic it as much as possible?
Is there any way for me to get the code from the working sample application?
@JoeyBodnar The Sample App is available in this repository itself in the directory /SampleApp. Please note that the SDK requires Location Always permission to be able to deliver notifications in the background.
Is there a set time limit for nearbee to stop scanning? When leaving the app open overnight and then walking by a beacon, it does not detect it. However, upon opening the app again it immediately detects the beacon. So it seems like the background scan works for a while but then stops. Has anyone else had this issue or any known workarounds?
I have the project setup exactly as the sample project describes.