devicemotion

How do I get DeviceOrientationEvent and DeviceMotionEvent to work on Safari?

随声附和 提交于 2020-05-26 11:46:10
问题 I'm trying to implement DeviceOrientationEvent and DeviceMotionEvent on my website for a 3D effect. However, the console doesn't log any info and apparently iOS 13 requires a user set permission to start doing this. I can't seem to figure out how to set it up properly. I've done some research and this is what I found: https://github.com/w3c/deviceorientation/issues/57#issuecomment-498417027 All other methods provided online are not usable anymore sadly. window.addEventListener(

How do I get DeviceOrientationEvent and DeviceMotionEvent to work on Safari?

自古美人都是妖i 提交于 2020-05-26 11:46:08
问题 I'm trying to implement DeviceOrientationEvent and DeviceMotionEvent on my website for a 3D effect. However, the console doesn't log any info and apparently iOS 13 requires a user set permission to start doing this. I can't seem to figure out how to set it up properly. I've done some research and this is what I found: https://github.com/w3c/deviceorientation/issues/57#issuecomment-498417027 All other methods provided online are not usable anymore sadly. window.addEventListener(

SWIFT: Changing view controllers with CMDeviceMotion

不羁岁月 提交于 2019-12-19 11:43:24
问题 I am following this article: http://nshipster.com/cmdevicemotion/ On how to use CMDeviceMotion. They named this part of the article: Keep It To Yourself I made a viewcontroller with a identifier called: PromptViewController. I get an error: Use of undeclared type 'PromptViewController' In the section: if let promptViewController = self?.storyboard?.instantiateViewControllerWithIdentifier("PromptViewController") as? PromptViewController {` Here is my full code: // ViewController.swift //

In IOS 11, DeviceMotion in background stopped working

依然范特西╮ 提交于 2019-11-30 13:33:06
My app reports and records location, altitude, rotation and accelerometer data (DeviceMotion) while in the background. This works fine on ios 10.3.3. On IOS 11, I no longer have access motion data while the device is locked. Altitude data and location data is still streaming to the console, though. Has something changed in IOS 11 that prevents me from accessing motion data or am I doing trying to access it in a way that Apple now blocks like OperationQueue.main Here is how I'm starting motion updates. If the phone is unlocked, all works fine. If I locking the phone, no more updates.: let

In IOS 11, DeviceMotion in background stopped working

。_饼干妹妹 提交于 2019-11-29 19:10:48
问题 My app reports and records location, altitude, rotation and accelerometer data (DeviceMotion) while in the background. This works fine on ios 10.3.3. On IOS 11, I no longer have access motion data while the device is locked. Altitude data and location data is still streaming to the console, though. Has something changed in IOS 11 that prevents me from accessing motion data or am I doing trying to access it in a way that Apple now blocks like OperationQueue.main Here is how I'm starting motion