EDIT: It seems I have lost an hour worth of work, which left the blocks messed up. The permissions are working now.
Me being an idiot
I noticed the problem on a project with a Canvas extension and Component2Image extension, both of which are capable of writing files. The app asks for both READ and WRITE on startup, and shows an error prompt if permission was denied.
Strangely enough, neither the Permission Granted, nor the Permission Denied event handlers were called, and the app silently stayed on the initial “loading” virtual screen.
I will conduct further testing today, because you have a valid point. Perhaps adding a component (maybe File or Canvas) will add the permission to the manifest.
Still, the changed behaviour seems to be suboptimal, and I must’ve missed the documentation. If someone points out the perks of the new system (assuming it isn’t a bug) or points me to the related documentation, it’d be great.
First of all a change in the last update of Kodular:
The File component now automatically asks for WRITE permission (and READ, worked also before the update).
If a component is used that automatically asks for WRITE permission, the events ArePermissionsGranted and .IsPermissionGranted are not triggered unless this permission has been explicitly (manually) requested:
If you do not ask for this manually, ArePermissionsGranted and IsPermissionGranted will only be shown after reloading the screen if you have also set the corresponding block in Screen.Initialize block.
Let’s take that as an example
File component (which automatically asks for READ / WRITE, at least since the last update) and
the TaifunFile extension (it does not automatically ask for READ / WRITE):
File does not require a manual request from the permissions and therefore ArePermissionsGranted and .IsPermissionGranted are not triggered. In order to guarantee this, however, you must also manually ask for this permission. Otherwise they are only triggered when the screen has been reloaded and the corresponding blocks have been set in Screen.Initialize:
With the TaifunFile extension you have to ask for the permissions manually anyway (see the documentation).
Note: TheTaifunFile ext. does not automatically ask for permissions for a good reason, since it wants to ensure that it also works even if read in / write to an app-specific folder. For that no permission are needed: Manifest.permission | Android Developers.