Closed kiritm-nimblechapps closed 4 years ago
Anybody did manage to make it work for region monitoring when app is closed?
You probably have to use an Android Foreground Service. Take a look at this package: https://github.com/voximplant/react-native-foreground-service . I didn't yet try it myself though. Please report here if it solves the issue! I would then add this info to the README.
Btw, how does your definition of closed relate to the appstate? When you observe the AppState is the app state background
?
Thanks @Andruschenko, this seems to work fine! When using a foreground service the beacons scanner seems to keep working.
There still seems to be a problem with detecting beacons in the background on android 8.1 >. When your screen is turned off no beacons are updated. This seems to be a bug in the Kontakt SDK. I have made an issue for Kontakt (#201).
@nylsoo did you find the solution of this problem? I am currently facing the same issue using react-native-beacons-manager and the same foreground service as you.
@nylsoo nevermind. I figured out by myself. Just updated version of altbeacons to the latest. react-native-beacons-manager from npm for some reason uses old build from 2017. Installing from their github repository directly will fix this issue.
@unkindypie Hi, could you tell what version the react-native-beacons-manager exactly should use and where do you change the version? Thanks :)
@izaa just use npm install https://git@github.com/MacKentoch/react-native-beacons-manager
to install the package from the latest commit at master. But I should say that it works perfectly on android >=8.1 including background, but for some reason stops detecting beacons on android <8.1. I tried some older commits from that repository and faced the same problem. If you find a solution, please share it.
@unkindypie ah ok! Yes I've tried that, but looks that this kontaktio works better than that manger. How do you feel which one is better?
@izaa in my opinion currenly both of them are bad for android. I have created an issue on react-native-beacons-manager, maybe someday someone will help us.
@unkindypie thanks for the info! So both work better in iOS? I haven't tried yet iOS.
I am currently contacting Kontakt to see if they could do something about this issue. They seem to be unresponsive on their own Github page.
Got in contact with the Kontakt support desk and it seems this issue won't be fixed any time soon due to lack of mobile developers... They recommended using another library like Alt Beacon.
Their response: Hi ...., Unfortunately as of right now, we can not assure that this feature will be implemented in the Android SDK. It has been noted but it will not be implemented in the near future because of the availability of our mobile developers. Solution, for now, would be using foreground services in Android and some other libraries that fit your needs as you mentioned before. I hope you understand Best regards,
Hello @unkindypie I am having issues with react-native-beacon-manager with react-native-background-actions when app is in background it receives empty beacons. Please advise how to fix issue? Thanks
Hello @unkindypie I am having issues with react-native-beacon-manager with react-native-background-actions when app is in background it receives empty beacons. Please advise how to fix issue? Thanks
Unfortunately I can't say you an exact answer(it's been 2y ago) but most likely it has something to do with permissions on background geo location. You can try requesting them and check is it detecting anything. And it's still a workaround, it's possible that after 2y there may be a better solution
Hi,
I have set region and start scanning in android. it's work fine when app in foreground. The data of beacon getting the results. but when App is closed, And after I checked the beacon is not connect.
Can you help me what is mistake in android.
Thanks.