Find Eddystone Beacons using Nearby Google API

£可爱£侵袭症+ 提交于 2019-11-28 06:10:53

问题


I attached data to Eddystone Beacons using The Proximity Beacon API. I want to fetch the Beacon attachments using Nearby Messages API.

I followed the steps mentioned at https://developers.google.com/nearby/messages/android/get-beacon-messages.

But I am not able to read Beacon attachments. The onFound() method is not getting called


回答1:


Check the following...

  • Set a callback on the response to subscribe and call startResolutionForResult on the Status object if the Status was APP_NOT_OPTED_IN . See github example

  • Make sure you've enabled the Nearby API in the Developer Console for your app. Step 3 here

  • Use Strategy.BLE_ONLY in the call to subscribe

  • Finally, if none of these help, try a stand-alone BLE scanning app just to make sure the beacon is actually broadcasting.

If you want to post a more complete code sample, one of our engineers can take a look

(I work on the Nearby API)




回答2:


Another idea: Make sure that the API key in your manifest is from the same Google Developers Console project that you used when you attached your data to the beacons. Beacon attachments are private to the project that created them.




回答3:


Another suggestion for anyone else reading this question who is having problems connecting. Lifted from another answer:

This may sound like an odd thing - but try turning you wifi on and off. A lot of cheaper devices are really bad with bluetooth and fail to connect, but for some reason turning wifi off and on fixes it for a while.

I was having a similar problem - everything in my code was correct but not detecting beacons. I even tried with the manufacturers app, and theirs also couldn't detect the beacon (but their iPhone version did). I turned my wifi off, then back on again and the manufacturers app worked and so did mine.



来源:https://stackoverflow.com/questions/32453165/find-eddystone-beacons-using-nearby-google-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!