Titanium JIRA Archive
Appcelerator Community (AC)

[AC-603] Intent for calling app permissions (Marshmellow)

GitHub Issuen/a
TypeNew Feature
Priorityn/a
StatusResolved
ResolutionDuplicate
Resolution Date2016-02-05T09:07:53.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterRainer Schleevoigt
AssigneeShak Hossain
Created2016-02-04T11:07:31.000+0000
Updated2016-02-05T09:07:53.000+0000

Description

In Marshmellow we have the new permission system. I.E. If I use Microphone for recording then a new permission in system configuration appears. !http://i.imgur.com/UMcc8vH.png! If I detect a no set permission we need a user friendly possibility to send the user to this window (screenshot). This snippet (of Fokke)
var intent = Ti.Android.createIntent({
   action: 'android.settings.ACTION_APPLICATION_DETAILS_SETTINGS',
   data: 'package://' + Ti.App.id
});
intent.addFlags(Ti.Android.FLAG_ACTIVITY_NEW_TASK);
Ti.Android.currentActivity.startActivity(intent);
doesn't work. The system doesn't find the activity. !http://i.imgur.com/2vZ8C1n.png! Here the full logcat output: https://gist.github.com/AppWerft/11361688e779f8c6962b The original code was:
Intent intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
Uri uri = Uri.fromParts("package", activity.getPackageName(), null);
intent.setData(uri);
context.startActivity(intent);
Any ideas to solve? Cheers! Rainer

Comments

  1. Fokke Zandbergen 2016-02-05

    To request permissions you should not send users to the app permissions screen, but prompt within the app. We have a ticket for providing a generic method to request permissions: TIMOB-20320

JSON Source