Jasonette / JASONETTE-Android

📡 Native App over HTTP, on Android
https://www.jasonette.com
Other
1.6k stars 270 forks source link

Add $util.getPermissions to action type #247

Open Akir4d opened 6 years ago

Akir4d commented 6 years ago

Added new action for android-jasonette to get permissions on android 6+, it returns "success" if android task of permissions is done, "error" if those permissions are already granted. As options you have to put permissions comma separated you need to granted, as example "permissions": "CAMERA,ACCESS_FINE_LOCATION".

Full code example:

"$load":{ "type": "$util.getPermissions", "options": { "permissions": "CAMERA,ACCESS_FINE_LOCATION" }, "error": { "trigger": "start" }, "success": { "type": "$util.alert", "options": { "title": "Read before continue", "description": "Press \"OK\" to continue.\n- Press \"CANCEL\" to exit." }, "success": { "type": "$flush", "success": { "type": "$reload" } }, "error": { "type": "$close" } } }