android - Permission settings restricting deployment platforms -


i have tried embrace new permission framework having problems.

my app has optional feature read sms messages (from bank) , if contains data (payment made) update app information.

this works fine if include in manifest:

<uses-permission android:name="android.permission.read_sms"/>  

i set permission mid app with:

public boolean getpermission(string type, integer permission ) {     // returns true if have permissions - false otherwise     if (activitycompat.checkselfpermission(context, type) != packagemanager.permission_granted) {         activitycompat.requestpermissions(activity, new string[]{type}, permission);         return false;     } else return true; } 

however, when deploy this, wont deploy tablet tablet not have sim card , no sms available - play services filters device , wont deploy it.

i can round using manifest line:

<uses-feature android:name="android.permission.read_sms" android:required="false"/> 

application deploys phone , tablet, not possible grant permission sms , in applications->settings there no toggle switch sms.

how can define sms 'optional' permission, , if exist provide access under normal permission manager?


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -