You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems we need the FragmentManager to be able to request permissions with Splitties, it would be nice if we could request perimssions from the AndroidViewModel context using just the application.
You just need to register the PermissionRequestActivity in the AppManifest and you are all set to use PermissionRequester.requestPermissions passing down two parameters: the app context and the list of permissions names you want.
The text was updated successfully, but these errors were encountered:
AndroidX ViewModel is not the right place to expose such an API IMO. It's better exposed in the UI, which is hosted in an Activity.
That said, I see a way to not require a FragmentActivity and allow it for any Activity. It's not on my priority list at the moment though.
LouisCAD
changed the title
Request permissions from ViewModel
Request permissions from any Activity (not just FragmentActivity)
Feb 17, 2021
It seems we need the FragmentManager to be able to request permissions with Splitties, it would be nice if we could request perimssions from the AndroidViewModel context using just the application.
Here is some example code on how to do that:
You just need to register the
PermissionRequestActivity
in the AppManifest and you are all set to usePermissionRequester.requestPermissions
passing down two parameters: the app context and the list of permissions names you want.The text was updated successfully, but these errors were encountered: