# Requesting Permission for Accessing Accelerometer Data

**URL:** <https://discourse.processing.org/t/requesting-permission-for-accessing-accelerometer-data/42402>\
**Category:** Beginners\
**Created:** [July 12, 2023, 1:46am UTC](https://discourse.processing.org/t/requesting-permission-for-accessing-accelerometer-data/42402 "2023-07-12T01:46:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arcriet](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@Arcriet](https://discourse.processing.org/u/Arcriet)\
**Post date:** [July 12, 2023, 1:46am UTC](https://discourse.processing.org/t/requesting-permission-for-accessing-accelerometer-data/42402/1 "2023-07-12T01:46:58Z")

</div>

Hi all,  
I am a beginner just starting to learn p5.js. The current version of iOS does not allow users to directly access accelerometer data in the browser. In older versions of iOS, one could enable this permission in the phone settings, but with the updates in privacy permissions in the newer versions, the switch for “motion & orientation access” has been removed. As a result, functions in the reference like accelerationX and similar ones cannot be used in the iOS system.

Regarding this issue, I found some similar posts in the past.

> [@Mobile functionality not working](https://discourse.processing.org/t/mobile-functionality-not-working/18362):
>
> Hi all, I’m interested in starting to use the mobile functionality with p5, but when I check the examples on their site: [https://p5js.org/examples/mobile-tilted-3d-box.html](https://p5js.org/examples/mobile-tilted-3d-box.html)[https://p5js.org/examples/mobile-acceleration-color.html](https://p5js.org/examples/mobile-acceleration-color.html)[https://p5js.org/examples/mobile-shake-ball-bounce.html](https://p5js.org/examples/mobile-shake-ball-bounce.html) The sketches load but don’t function as they should (when I move my phone nothing happens). Does anyone have insight on this? I’m using an iPhone 7 Plus. Thanks! Tori

Following this post: [How to Request Device Motion and Orientation Permission in iOS 13 | by Lee Martin | Medium](https://leemartin.dev/how-to-request-device-motion-and-orientation-permission-in-ios-13-74fc9d6cd140), I tried to enter the code mentioned into the p5 editor. However, the console says there is no requestPermission() function. Does this mean that p5.js does not have this function built-in? Is there any compatible solution?

Additionally, I would like to know why the code given by Leemartin on the second website, which I believe is JavaScript, cannot run in the p5.js editor?  
Thanks!  
Arc
