g-ortuno / eddystone-chrome-apps-demo

Chrome App that advertises a different URL depending on the image

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An advertisement is already advertising

tvanier opened this issue · comments

Thanks for the great demo app, I just tried it on my Chromebook (dev channel with the enable-ble-advertising-in-apps flag turned on)
Version 49.0.2587.3 dev
Platform 7729.0.0 (Official Build) dev-channel daisy
Firmware Google_Snow_Rev4.2695.128.0
The initial registerAdvertisement promise is rejected with the "An advertisement is already advertising" message. eddystone.advertisements is empty. chrome.runtime.lastError does not seem to contain more info. I see the same error with my own sample app. What could cause this error? Is there a workaround?

What chromebook are you using? Make sure Bluetooth is turned on and try closing the app and restarting the chromebook.

Thanks @g-ortuno . I tested on a 2013 Samsung XE303C12-A01US. It seems to work after connecting a USB dongle - an Asus BT400 I think, which came with my Chromebox CN60 (I have not tested the demo app on the Chromebox yet)).
I can see advertised URLs on my Android phone when the app is started after the Chromebook booted, but I see the same "An advertisement is already advertising" when restarting just the demo app. Should Eddystone.advertisements only contain 1 single advertisement at a time?
On what hardware was the demo app tested? More generally, does eddystone require Bluetooth v4?

Yes. Bluetooth 4.0 doesn't support multiple Adv Packets at the same time, so you have to unregister a previous advertisement in order to register a new one. That's one of the reasons the feature sits behind a flag.

I tested it on a Chromebit, a Pixel and a couple chromeboxes. All of them have BT 4.0. Let me know if you have any more problems/questions.

Thanks @g-ortuno , I will test on my Chromebox. I was wondering about the options to see the advertised URL on Android? I am testing with the Physical Web app, there may be other ways for a demo? Can Chrome itself display Adv Packets?

They are working on that! It is currently behind a flag on Chrome for Android:

https://phy.net/2015/11/enable-the-physical-web-for-chrome-dev/

Thanks @g-ortuno for all the info, the demo app works great on my Chromebox, I can see the advertised URL in Chrome Dev for Android! Feel free to close this issue.