Access Device Motion API using JavaScript in Bubble

Hi!

I am trying to build an IoT demo app acting and sending simulated IoT data.

I would like to access the Device Motion API (https://whatwebcando.today/device-motion.html) running JavaScript and using the device (iOS or Android) sensor readings in updating my UI and sending the measurements onwards.

So:

  1. how do I set up access to the Device Motion API? Is it even doable in Bubble?

  2. if it is, how do is “send the data back to the UI” from the JavaScript snippet?

  3. since a late version of iOS there is a requirement to ask permission before accessing the API, how can I handle that in Bubble / JavaScript?

Grateful for all hints and comments on the matter.

1 Like

Any luck with this?