Version 2.0 (Update)
Problem with the OnPermissionRequest block was solved and the variable grantedAll was implemented (returns true if all permissions were granted). It is worth noting that the block will not be called during emulation, because Activity is only added when exporting the application.
Now it’s got simpler, faster, more practical and charming when calling your permissions!
5 Likes
vknow360
(Sunny Gupta)
May 25, 2020, 2:55am
#22
jarlissonlira2:
The problem was that I was not getting a response from the requestPermission method in the main class and there was no way to extend the class to Activity. So, I chose to create a new class by extending the Activity to be able to call the requestPermission method and get the result in onRequestPermissionsResult.
This could be easily fixed using PermissionResultHandler
class from App Inventor.
You can use it in this way:
public void FileAccess(boolean follow) {
LoadLocalFiles = follow;
if (!hasReadAccess){
new Handler().post(new Runnable() {
@Override
public void run() {
form.askPermission(Manifest.permission.READ_EXTERNAL_STORAGE,
new PermissionResultHandler() {
@Override
public void HandlePermissionResponse(String permission, boolean granted) {
hasReadAccess = granted;
}
});
}
});
if (hasReadAccess){
webView.getSettings().setAllowFileAccess(LoadLocalFiles);
webView.getSettings().setAllowFileAccessFromFileURLs(LoadLocalFiles);
webView.getSettings().setAllowUniversalAccessFromFileURLs(LoadLocalFiles);
webView.getSettings().setAllowContentAccess(LoadLocalFiles);
}else{
webView.getSettings().setAllowFileAccess(false);
webView.getSettings().setAllowFileAccessFromFileURLs(false);
webView.getSettings().setAllowUniversalAccessFromFileURLs(false);
webView.getSettings().setAllowContentAccess(false);
}
}
}
Btw nice extension
4 Likes
I’ve seen this shape before, but there’s no way to put an Array at the entrance. It would be possible to solve with a for, but there would not be a sequence of permissions in the same dialog.
5 Likes
Great, but you might want to reduce the icon size of your extension (512x512 → 20x20 px):
App Inventor / AI2 :
2 Likes
I linked this in the AI2 forum.
3 Likes
Problem solved, I just updated.
2 Likes
I’m using this very good extension. Compliments. How can i compensate?
1 Like
Its use is already the reward.
4 Likes
not fair… i feel in debt
thanks anyway
2 Likes
Amazing! Thank you for working for the community.
2 Likes
Note : The extension no longer works with the AndroidX libraries (→ AI2). @jarlissonlira2
1 Like
vknow360
(Sunny Gupta)
August 4, 2020, 10:27am
#32
You mean @jarlissonlira2 will have to migrate to AndroidX?
1 Like
As Evan Patton said, “the extension author will need to update their extension to use the AndroidX libraries as Google has deprecated the older Android Support libraries and we are no longer using them in App Inventor.”
But Kodular still uses the Support library, as @Mika said:
We don’t use android x… Not now. In the future yes.
2 Likes
… and that’s why I asked you:
Yes, but what about your own extensions? Do they use / need the AndroidX libraries? If so, have you already adjusted your extensions accordingly so that they will work with AndroidX (after the Kodular update; whenever that will come)?
See also here:
1 Like
vknow360
(Sunny Gupta)
August 4, 2020, 10:53am
#35
Kodular is in full mood to play game with us
1 Like
If I request all permissions on screen1, do I no longer need to request when I get to screen2?
themaayur
(Mayur Berad)
October 8, 2020, 5:37pm
#37
No, you don’t need to request for permission again, if they are once granted.
2 Likes
Why does this problem always occur after I add it
CJcorp
(Asit)
October 9, 2020, 3:54am
#39
It’s better to always ask for solution with errors are you getting and blocks you tried
1 Like
I tried but couldn’t find the answer to this kind of question