Camera plugin not saving to Gallery


I have this code:-

var camera = require("nativescript-camera");

exports.onTakePicTap = function(){
var milliseconds = (new Date).getTime();
var options = { width: 480, height: 480, keepAspectRatio: true, saveToGallery: true };
camera.takePicture(options).then(function(picture) {
        appSettings.setBoolean("vehiclephoto", true);
        myImage.src = picture;
        console.log("Picture = "+picture);
        picture.saveToGallery = true;
        }).catch(function (err) {
        console.log("Error -> " + err.message);

I cannot get the image to save to the Gallery no matter what I try.


Refer plugins docs carefully, saveToGallery is a property of options object.


I have set var options saveToGallery: true as per my code.

The issue was I had not requested permissions to use the photos.