Nico Sap created CB-9947:
----------------------------
Summary: Can't get PickContact working
Key: CB-9947
URL: https://issues.apache.org/jira/browse/CB-9947
Project: Apache Cordova
Issue Type: Bug
Components: Plugin Contacts
Affects Versions: 1.1.0
Environment: android 6.0
Reporter: Nico Sap
I first checked for the tests if something was wrong with my code, but there
doesn't seem to be any concerning PickContact
I always have a permission error, although my AndroidManifest seems correct.
Using 1.1.0 and also tested it with 1.1.1-dev, both have the same issue.
document.addEventListener("deviceready", function () {
navigator.contacts.pickContact(function (contactPicked) {
$scope.contact = contactPicked;
});
});
I get the list of contacts, i can pick one. Instead of returning the
ContactInfo, the app crashes and gives a permission error ( which is included)
My Android manifest looks like:
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="100009"
android:versionName="1.0.1" package="io.cordova.myapp557da2"
xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true"
android:normalScreens="true" android:resizeable="true"
android:smallScreens="true" android:xlargeScreens="true" />
<uses-sdk android:maxSdkVersion="23" android:minSdkVersion="19"
android:targetSdkVersion="23" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-feature android:name="android.hardware.telephony"
android:required="false" />
<application android:hardwareAccelerated="true"
android:icon="@drawable/icon" android:label="@string/app_name"
android:supportsRtl="true">
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
android:exported="true" android:label="@string/activity_name"
android:launchMode="singleTop" android:name="MainActivity"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="adjustResize">
</activity>
</application>
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
</manifest>
The error i'm receiving is :
Caused by: java.lang.SecurityException: Permission Denial: reading
com.android.providers.contacts.ContactsProvider2 uri
content://com.android.contacts/raw_contacts from pid=7739, uid=10141 requires
android.permission.READ_CONTACTS, or grantUriPermission()
But READ_CONTACTS permission is included in my AndroidManifest.xml
PS. In my current AndroidManifest.xml i changed
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
So that the parent Activity uses an attribute exported:true, but that doesn't
change the error.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]