How can permissions be added to an Android export?
In detail do I have to add the following to the generated AndroidManifest
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
I solved it.
I added the following line to my Type declaration in the .uxl
<Require Android.Manifest.RootElement="<uses-permission android:name="android.permission.CAMERA"/>" />
Well you beat me to it! This will work for uxl.
For those using bindings you can do the following:
Permissions.RequestPermission(Permissions.CAMERA);
Iain
August 30, 2017, 2:23pm
4
Given that I can do this for <uses-permission>
:
<Package>
<Extensions Backend="CPlusPlus" Condition="Android">
<Require AndroidManifest.Permission="android.permission.NFC" />
</Extensions>
</Package>
Is there a better (neater) way I can add <uses-feature>
than the method suggested above?
Eg. for <uses-feature android:name="android.hardware.nfc.hce" android:required="false"/>
Thanks!
Uldis
August 30, 2017, 4:25pm
5
Looking at other libraries , it seems there is a better way. Here’s more details on what else you can do to Manifest .
Baggers
September 1, 2017, 12:19pm
6
@Iain actually it’s best not to set permissions that way as then you can end up with issues on android versions >6. See here for details https://www.fusetools.com/docs/native-interop/android-permissions