How to use .RequestAppPermission?


#1

can anybody show an example blocks implementing Screen1.RequestAppPermission properly ? Some of my questions are, where to call this method ? what will happen if user doesn’t allow ? how to check whether the permission is given or not ? What are the Cont’s (if any) ?


#2
  1. You don’t need to use this for built in Components.

  2. It may be needed for some Extensions to work properly.

  3. This will only affect Android 6.0 and newer devices.

where to call this method ?
Screen.initialize or before a feature is used that requires permissions.

what will happen if user doesn’t allow ?
This depends on which permission hasn’t been granted and how you are using the feature.

how to check whether the permission is given or not ?
This isn’t possible currently. @Hossein this would be a Great feature to have.

What are the Cont’s (if any) ?
What’s a Cont?


#3

I’m facing a problem, when i open my app it pops up storage permission ( even if i don’t call this method ) and within some mili seconds my App get crashed. that never happened before the new release.


#4

Are you using the File Component or an Extension?


#5

I used image picker component and some other extensions.


#6

Which extensions?

Edit:
If you manually enable the permissions in Settings or use Live Testing does the app run properly?


#7

i used these extensions

extensions

it keeps on happening unless i give the permission…


#8

i think this is because i made my first screen as splash screen and when it requires permission meanwhile other screen get opened and so the App get crashed. How to stop this permission dialog ??


#9

It will check if Permission is Granted if not, it asks the user for Permission.
That is the desired behavior as it cannot do what it’s attempting to do without user consent.


#10

Allowing the requested permission doesn’t make the popup go away?


#11

@Ken is correct. The .apk will check to see what permissions exists at app level. This will be true when no extension is used. However, IF extension is used AND it uses one of the sensitive permissions (e.g. Camera / Storage / etc), then you’ll need to call the Screen1.RequestAppPermissions block


#12

Yes, ones the permission is given then it doesn’t pop up anymore. But the Problem is it keeps on crashing my app untill the permission is given which i think will be very irritating to my users.
the problem is as the App is opened the permission dialog pops up and as i made my first screen as splash Screen which opens another screen after 2 seconds, so before interacting with the dialog the app get crashed as the other screen opens up. How can i solve this ??


#13

Did you add the permission request in your screen initialize?


#14

No, i did NOT add any


#15

Which Components are you using?


#16

a lot components how can i tell one by one


#17

is there any event which get triggered when user interact with permission dialog ??


#18

Are you using File Component or any other Components that would require file access?


#19

The crash is maybe not part of the request app permission. You use an extension for sidebar. What if you use the internal one. Maybe that is causing the crash.


#20

yes I’m using Image picker .