Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-19851

Android: Permissions (Camera) crash and other bugs


    • Sprint:
      2015 Sprint 22 SDK


      The following sample will always call back with success:false without showing the dialog:

      if (Ti.Media.hasCameraPermissions()) {
      	return alert('You already have permission.');
      Ti.Media.requestCameraPermissions(function(e) {
      	if (e.success) {
      		alert('You were granted permission.');
      	} else {
      		alert('ou were denied permission for now, forever or the dialog did not show at all because it was denied forever before.');

      To make it work you need to declare the permission in tiapp.xml, which is not documented in either the Ti.Media Reference nor Camera and Photo Gallery APIs Guide or tiapp.xml Common Requirements.

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

      If you do so Android 6+ will prompt for two permissions:

      The first time after each new install I deny either one of two the callback will receive success:true but the next call to Ti.Media.hasCameraPermissions() will still return false and Ti.Media.requestCameraPermissions() will again prompt for both permissions, including the one I already granted.

      After the first time I deny only one of two permissions, every next time I do the exact same thing the app crashes with the attached log as soon as I deny the first or second permission.


          Issue Links



              • Assignee:
                hpham Hieu Pham
                fokkezb Fokke Zandbergen
                Ashraf Abu (Inactive)
              • Watchers:
                0 Start watching this issue


                • Created:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    Sync status:
                    Last received:
                    Last sent:

                    Git Source Code