Tutorial for a sequence of permissions?

let say there are 10 different permissions that the app needs to ask for.
how do i make a system through blocks so that after the first perm is asked for, and is accepted, it shows the popup for the second permission and so forth until all permissions have been asked?.
as the topic says, i was surfing through the forum to find something but i couldnt find none. are there any examples someone can lead me to?

In my alarmmanager extension examples I'm using a clock like this

Taifun

1 Like


i know and i have tried it and it does work, but only the alarm managers permissions, the popups for the rest of the permissions do not appear

Example:

grafik

A permission is a piece of text and can never equal true or false.

What you need is a test if a permission has been granted.

I can't answer that, unfortunately.

1 Like

GetASD_4.aix (8.3 KB)

1 Like

The tools extension offers method IsPermissionGranted, which also works with the permission helper blocks
.

Taifun

1 Like



i followed your example but somehow permssions just stop after the fine location.
these are the relevant blocks, i dont seem to understand what the issue is
it might be because of the location sensor as well, but even when i removed it, it didnt seem to work.
heres an example project
nn.aia (2.3 KB)

thank you, ill try this

(added to FAQ)

i figured the problem out.
This is definitely an issue of the locationsensor itself(even if its not included in the screen.initialise blocks)
if theres a location sensor in the app, it asks for the location perms for itself and does not register anything for the sequence of the permissions as the ask for permission in the screen1.initialise is not used at all as far as i can tell. and so, the permission granted cannot be used too. i think the workaround is using an alarm as well as using taifuntools for getting permission granted blocks.
update: this is not working too^

yes, for the alarmmanager you should ask for permissions in a Clock.Timer event as shown in the example project,
you also could add to ask for the other permissions using the IsPermissionGranted method there

Taifun

okay, i understand. unfortunately, the location sensor"s permission is not allowing me to move a step further.
i tried to use taifuntools but to no success.
nn (1).aia (25.9 KB)
in this aia file, even if i do not put askforpermission block at screen.initialise, it still asks for the location but it doesnt register for even the taifuntools block.

If you are asking for help, I recommend you to make it as easy for others to be able to help you ...
You probably will get more feedback then...

which means in your case post a screenshot of your relevant blocks...

To download the aia file, upload it to App Inventor, open it, do some bug hunting for you, etc... this takes time, and most people will not do that...
Thank you.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

1 Like

thank you for the tip, got it.




i ignored the permission for the fine location as location sensor asks for it anyway and proceeded to add the rest of the permissions like this, and it works.
thank you for everyones help so far

1 Like

If the LocationSensor is enabled in the designer, the location permissions are requested automatically without triggering the PermissionGranted event. Therefore, the LocationSensor should be disabled in the designer and the permissions requested in the same way as shown above. The LocationSensor can then be enabled via the blocks as needed.

grafik

2 Likes

nn_2.aia (3.0 KB)

grafik
Android 13 – 16.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.