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

iOS: Opening camera on iPhone X shows splash screen after permissions accepted

    Details

      Description

      When opening requesting permissions to open the camera on an iPhone X if the forceSplashAsSnapshot is set to true the splash screen will display instead of the camera and the application has to be killed.

      Steps to reproduce:

      1. Create a sample application
      2. Update the index.js with the attached
      3. Update the alloy.js with the attached
      4. Update the tiapp.xml with the NSCameraUsageDescription key in the attached tiapp.xml
      5. Run the application and click on "Hello World"
      6. Accept permissions
      7. Notice camera loads, but then default splash screen is displayed over the camera.

      Example:

       
      var win = Ti.UI.createWindow({
          backgroundColor: '#fff'
      });
       
      function doClick(e) {
      	var _cameraSettings = {
      		saveToPhotoGallery : false,
      		showControls : true,
      		allowEditing : false,
      		mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO]
      	};
       
      	if (Ti.Media.hasCameraPermissions()) {
      		//we have permissions, open the camera
      		Ti.Media.showCamera(_cameraSettings);
      	} else {
      		//must request camera access
      		Ti.Media.requestCameraPermissions(function(_evt) {
      			if (_evt.success) {
      				//permissions were granted, open camera
      				Ti.Media.showCamera(_cameraSettings);
      			} else {
      				alert('We need camera permissions');
      			}
      		});
      	}
      }
       
       
      var btn = Ti.UI.createButton({
          title: 'Trigger'
      });
       
      btn.addEventListener('click', doClick);
       
      win.add(btn);
       
      win.open();
      

      tiapp.xml:

      ...
         <key>NSCameraUsageDescription</key>
        <string>To allow you to take photos of documents for uploading</string>
      ...
      

        Attachments

          Activity

            People

            • Assignee:
              hknoechel Hans Knöchel
              Reporter:
              jceaser Joshua A. Ceaser
              Reviewer:
              Vijay Singh
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code