Accelerometer on iBook

Hi ! Back to hype for a new project and I have an issue : the accelerometer doesn’t work anymore when you export for an iBook ? as a widget ? I have an iPad on iOS 13…

Unfortunately this feature has been disabled: Hype4 phone Tilt to control gravity not working on IOS 12?

Ok… That’s a bad news… What is the possibility to use it ? Should I develop an app using hype ? because it works using hype reflect. Is there any solution ?

I've done that. Example...

...and now I prefer apps over iBooks. I just had too many problems with iBooks Author. Although, if you're going to publish a book as an app, it might get rejected. If it looks more like a book, and less like an animated app, Apple might point you back to the iBooks Store. That's why my developer page has an app with a glaring notification.

34%20PM

I was thinking to use that : https://www.youtube.com/watch?v=bYuyhY9VIjY
Create an app with Xcode and hype… Maybe it will be possible to use the accelerometer ?

Getting accelerometer data has been evolving over several iOS releases.

  • In iOS 11 and below, it was fully possible to get this data without doing anything.
  • iOS 12 required users changing a setting in their iOS Preferences, clearly not ideal.
  • iOS 13 allows developers to explicitly make a call for a user permission prompt. Serving over HTTPS is a secondary requirement as well.

Unfortunately this DeviceMotionEvent.requestPermission() call won’t work in the iBooks environment from what I can tell.

There are folks who have put this call into a WKWebView within a native app and had it work. It appears that a requirement (perhaps a bug) is that a WKUIDelegate must be set on the view for it to work. However it isn’t clear to me if this can work with local content; you may still need to serve the page over HTTPS.