ListPermission: with this extension it is possible to make a whitelist at once

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

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 :+1:

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. :smiling_face_with_three_hearts:

4 Likes

not fair… i feel in debt :smiley:
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

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:

2 Likes

… and that’s why I asked you:

1 Like

Kodular is in full mood to play game with us :joy:

1 Like

If I request all permissions on screen1, do I no longer need to request when I get to screen2?

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

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