Reputation: 498
My question is surrounding asking a user permission for 2 different things.
Currently I have an intent that asks for the users location, I have another intent user_locate
with the Event actions_intent_PERMISSION
. This intent performs a bunch of logic after the user allows location access.
I'm creating a new intent, that I want to use to send push notifications to the user with. This requires me to again ask the users permission - is there a way for this permission request to fire a different event? Or do I essentially need to handle all actions_intent_PERMISSION
events in a single intent?
Thank you.
edit: would this be a suitable solution for scheduling push notificatins?
Upvotes: 2
Views: 105
Reputation: 50701
You can handle the same Event in different Intents. You'll need to set the Context at the same time you send the permission request to differentiate between the two different requests. So when you send the location request you could also set the requestLocation
Context with a short lifespan and when you send the notification request you would also set the requestNotification
Context with a short lifespan as well.
You would then have Intents that might look something like this:
Upvotes: 2