Hi,
I've got an app since 5 years that requires storage access to download and display an offline map.
Since the new AIR release (and probably since the new Android release), my app is refusing to display the map :
Error #3001: File or directory access denied.
I didn't change the code of my app, so I suppose it's because of the new version of Android
I was using the ANE "PermissionCheck" of myflashlab but the ANE hasn't been updated since 2 years old (and myflashlab closed...).
My current code is :
Function checkPermissions():void{
trace("Checking Permissions");
PermissionCheck.init();
var permissionState:int = PermissionCheck.check(PermissionCheck.SOURCE_STORAGE);
if (permissionState == PermissionCheck.PERMISSION_UNKNOWN || permissionState == PermissionCheck.PERMISSION_DENIED)
{
PermissionCheck.request(PermissionCheck.SOURCE_STORAGE, onRequestResult);
trace("Request Permission Storage");
}
else
{
trace("permission storage ok");
requestGeolocationPermission();
}
function onRequestResult($state:int):void
{
if ($state != PermissionCheck.PERMISSION_GRANTED)
{
trace("STORAGE NOT ALLOWED");
}
else
{
//init();
trace("STORAGE is allowed by user");
}
}
}
And my XML has :
<android>
<colorDepth>16bit</colorDepth>
<manifestAdditions><![CDATA[
<manifest android:installLocation="auto">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" />
android:requestLegacyExternalStorage="true"
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
Can someone help me to update my code for checking Permissions in AS3 with these new restrictions please ?
It would help a lot !
Thank you,