- Home /
BLUETOOTH_SCAN and other new permissions
Android API 12 introduces some new permissions requirements. Here is a page describing them:
https://developer.android.com/guide/topics/connectivity/bluetooth/permissions
The docs say they are runtime permissions that need to be asked for by the app.
I am using the Permissions class right now to ask for fine location. Does anyone know if / when Unity will add support for these? Can I just pass in the INT value for the permission even if Unity doesn't know about it?
Answer by cyliax · Apr 22 at 11:55 AM
As far as I can see, the predefined permissions like "Camera" etc. are just string constants, not an enum. So Permission.RequestPermission accepts any permission as a string. As you can find in the generated meta data of Permission.cs:
For permissions which Unity has not predefined you may also manually provide the constant value obtained from the Android documentation here: https:developer.android.comguidetopicspermissionsoverview#permission-groups such as "android.permission.READ_CONTACTS".
Thank you for sending this. I figured out the same thing and can confirm that it works fine. Just look up the defined string value in Android Studio or some other Android dev tool and then paste that into your Unity app.
Your answer
Follow this Question
Related Questions
Standalone OSX players can't start after having been through DropBox 0.7.110 1 Answer
Weird Permissions When Building Android APK 1 Answer
Which permission/How to upload screenshot to Facebook after 2018 May (Cambridge event) 1 Answer
Get Facebook Profile Picture Permissions From Dev Token 0 Answers