Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Requesting READ_PROFILE permission at runtime

According to the Android documentation (https://developer.android.com/reference/android/provider/ContactsContract.Profile.html), I need to request the android.permission.READ_PROFILE permission to read the user's profile information.

However, when I attempt to create runtime permission request, there is no Manifest.permission.READ_PROFILE I can use. Do I just use the Manifest.permission.READ_CONTACTS permission instead?

Note: The AndroidManifest.xml file can find the permission just fine:

<uses-permission android:name="android.permission.READ_PROFILE" />
like image 552
Baracus Avatar asked Nov 20 '17 19:11

Baracus


People also ask

How do I request runtime permission?

Requesting Android Runtime Permissions For this the following method needs to be called on every permission. checkSelfPermission(String perm); It returns an integer value of PERMISSION_GRANTED or PERMISSION_DENIED.


1 Answers

READ_PROFILE permission was removed on API 23 as you can see here

https://developer.android.com/sdk/api_diff/23/changes.html

You should ask for GET_ACCOUNTS, or any of the permissions belonging to the CONTACTS group

https://developer.android.com/guide/topics/permissions/requesting.html#perm-groups

like image 125
heisen Avatar answered Oct 10 '22 20:10

heisen