Closed pNre closed 2 years ago
Hello,
I've reproduced what you're seeing, and it's a bug. I'm working on a fix, and it will ship with the next release.
A possible workaround: When your app is backgrounded, deallocate the GNSMessageManager; when it is foregrounded, re-create it. The stale beacon state is store in this object, so creating a new one will start fresh. (Use the UIApplicationDidEnterBackgroundNotification and UIApplicationWillEnterForegroundNotification notifications.)
Thanks for the bug report, and apologies for the hassle!
Hi, I've been noticing an odd behavior during my test of the NearbyMessages library. Here are the steps I've been following:
deviceTypesToDiscover = kGNSDeviceUsingNearby | kGNSDeviceBLEBeacon
subscriptionWithMessageFoundHandler
is called with the expected message when the beacon is rangedmessageLostHandler
is called with the expected messagesubscriptionWithMessageFoundHandler
is called again with the same messages from the offline beaconmessageLostHandler
isn't called againWhat I expect here is for
subscriptionWithMessageFoundHandler
to not be called again if the beacon is no longer in range. The same thing happens using the sample app from this repo.Do you have any advice? Thanks