Search code examples
androidangular2-nativescriptnativescript-camera

Nativescript-Camera doesn't show tick nor cross after taking a photo


The first time the camera is loaded on an emulator, the user is asked for permissions. The standard permissions to access the device camera are requested, but unexpectedly the user is also asked if they want the device to have access to their location.

Whether or not the user agrees to allow the app to have access to their location, the next screen is the take photo screen (as expected). However, when the user clicks on the camera icon to take a photo, they are not shown the tick or cross asking them if they want to keep the photo. Instead the camera button displays and they can continue taking photos indefinitely.

If the user presses the back button and goes into this screen again, then the user is redirected to the page with the tick and the cross as expected.

I'm guess that this is caused by a race condition, where the take photo starts before all the permissions are approved.

The code to take the photo appears to be waiting for the permissions to have been granted:

 camera.requestPermissions().then(
     function success() {
         var options = { width: 300, keepAspectRatio: true, saveToGallery: true };
         var takePictrue = camera.takePicture(options);
         takePictrue.then((imageAsset: ImageAsset) => {
...

After taking a photo a see this screen: enter image description here

When I expect to see this screen:enter image description here


Solution

  • This has been recognised as a bug. The fix will hopefully be released soon.