When you are going to be accessing the user's media you must check that your application has been allowed access. To this end the extension provides several helpers to check and request access to the camera roll. Normal permission rules apply here.
On Android these permissions are listed through the manifest additions.
On older versions of Android these permissions are accepted when the user installs the application.
More modern versions (Marshmallow 6 [v23]+) require that you request the permissions similar to iOS.
You will still need to list them in your manifest and then follow the same code below as for iOS,
except that on Android you will be able to ask multiple times.
You should respect the
SHOULD_EXPLAIN status by displaying additional information to your user
about why you require this functionality.
On iOS the user must be asked at runtime, which you only get one chance to ask, after which you must direct the user to manually change the permissions in the settings.
The following code will work across both platforms:
If your user has denied permission you can direct them to the device application settings to change them, particularly in the iOS case where you cannot force the request dialog to appear again.
To do this you use the
canOpenDeviceSettings property allows you to ensure the device and platform supports opening the settings and inform your user appropriately.