How can I grant permission to write and read for an app using ARFoundation? When I add some functions that should grant a permission …
using UnityEngine.Android;
Permission.RequestUserPermission(Permission.ExternalStorageRead);
… it seems to get totally ommited and asks only for camera, which I believe is requested somewhere in ARCameraManager script. Is there special class / script for ARFoundation to use or introduce when I want to grant extra permissions? I am aware that, ARCore itself has something like GoogleARCore.AndroidPermissionsManager but it is not the case this time.
Unity might already be requesting ExternalStorageRead by default (at install-time?)
Just a guess though. Trying some other permission-types might provide more details.
I have checked and manifest in apk got the line , nonetheless when app is running first time it asks only for camera permission.
I was looking for a solution to this problem because I am trying to control a GPIO microcontroller via usb through AR Foundation based app. I am getting an error: IOException: Permission denied so I thought that it may be somehow caused by not granting the app permission for aforementioned ExternalStorageWrite.
I know that this error gets into the app somewhere after the build, because when I try to control the gpio from the unity editor (pc’s USB “COM4” port) it works perfectly. I am aware that port adress is different when app is deployed on smartphone, so I found this adress using USB Device Info app (/dev/bus/usb/001/002).
Can I be right that this is connected with permissions or do I have to look elsewhere for a solution to this error?