简体   繁体   中英

Dialogflow: Need to ask user permissions every time app is invoked?

My Dialogflow app calls app.askForPermission() to have the user grant permission so that my app can get his location.

Do I need to ask the user for this permission every time he launches the app? I am hoping I only need to ask a given user once.

Currently, yes you will need to request the permission each time you want to access that value. However, you can cache the result that you get between steps of a conversation using the JSON object app.data . You can also cache the result that you get between sessions using the JSON object app.userStorage . In these cases you should make sure the user is aware that you are caching this data in your app and in your privacy policy.

app.userStorage.lastLocation = <location result>

Then you can use it the next time the user starts your app.

This can be not ideal in certain circumstances depending on the use case of the app and the level of granularity you are seeking.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM