google / eddystone

Specification for Eddystone, an open beacon format from Google
Apache License 2.0
3.07k stars 761 forks source link

Not Advertising: Cannot read property 'registerAdvertisement' of undefined #212

Open jptechadv opened 7 years ago

jptechadv commented 7 years ago

I am trying to run the example on ChromeOS using an AOpen Chromebase machine. I have opened the project using a chrome app IDE called puresolid (it lets me load and run the project locally on the chromebase). The app loads and displays and all appears to function until I try and click Update Advertisement then I see the error Not Advertising: Cannot read property 'registerAdvertisement' of undefined but no more information.

How do I solve this problem?

g-ortuno commented 7 years ago

Can you open a console in the app and check if you have chrome.bluetoothlowenergy.registerAdvertisement?

jptechadv commented 7 years ago

Sorry I'm really new to all this. How do I do that exactly? Thanks for your help.

jptechadv commented 7 years ago

Not sure if this is correct but I opened a console and started to type chrome.blue to see if autocomplete was working and it didn't know how to complete the .bluetoothlowenergy part.

What does that mean?

g-ortuno commented 7 years ago

That is strange. What version of Chrome OS do you have? You can check by going to about:version on Chrome.

jptechadv commented 7 years ago

57.0.2987.146 (Official Build) (64-bit)

Does that help?

g-ortuno commented 7 years ago

Just to confirm. You opened the app, then the console (by clicking inspect or following instructions here). Then you tried to type chrome.bluetoothLowEnergy and it didn't autocomplete?

jptechadv commented 7 years ago

Yep exactly what I did.

Ran app and it opened a new tab with it running, I pressed CTRL-SHIFT-I and went to the console tab and started typing chrome.blue and it didn't autocomplete :(

I have the flags enabled and there is also a setting 'Enable bluetooth' and that is checked as well.

g-ortuno commented 7 years ago

Are there any APIs under chrome?

jptechadv commented 7 years ago

Im not exactly sure what you mean but id say 'No' because what is shown all looks like properties or something.

When I type chrome.? I see

app csi loadTimes runtime webstore constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf defineGetter defineSetter lookupGetter lookupSetter proto

and that's it

Curiously I get the same thing on my windows machine :(

Have I forgot to enable something??

g-ortuno commented 7 years ago

Ah that means you are not running an actual Chrome App just a tab.

jptechadv commented 7 years ago

OMG! damn I feel silly. OK so can you point me to some way to get your sample from github and run it as a chrome app?

I feel really stupid now :(