Uploaded image for project: 'Documentation'
  1. Documentation
  2. TIDOC-2352

Android: Permissions (Contacts) Required changes to tiapp.xml not documented

    Details

    • Type: Bug
    • Status: Closed
    • Priority: None
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: APIDoc, Guides
    • Labels:
      None
    • Severity:
      Major

      Description

      The following sample code will always call back with success:false on Android 6.x+ devices:

      if (Ti.Contacts.hasContactsPermissions()) {
      	return alert('We already have permission.');
      }
       
      Ti.Contacts.requestContactsPermissions(function(e) {
       
      	if (e.success) {
      		return alert('We were granted permission.');
       
      	} else {
      		return alert('You don\'t have the required uses-permissions in tiapp.xml or you were denied permission for now, forever or the dialog did not show at all because it was denied forever before.');
      	}
       
      });
      

      It requires this permissions to be added via tiapp.xml:

        <android xmlns:android="http://schemas.android.com/apk/res/android">
          <manifest>
              <uses-permission android:name="android.permission.READ_CONTACTS" />
              <uses-permission android:name="android.permission.WRITE_CONTACTS" />
          </manifest>
        </android>
      

      This should be documented here:

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ingo Ingo Muschenetz
                Reporter:
                fokkezb Fokke Zandbergen
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Source Code