Does anyone have problem with Base64 to gallery plugin

Last time, the app was checked (around a month ago), it was working and images were saving to the iphone’s gallery. Now there weren’t any error, but then images weren’t save to the gallery. Checked images, they were fine. Location, looked fine. Does anyone else have this problem?

maybe you should have a timer(timeout) function in order to pass the variable(image file uri). This has been in my case…

Thank for your reply, could you explain a little more on how to use this timeout function?

function store_image (base64){
cordova.base64ToGallery(base64,“Image_”,
function(url){
console.log(“success”);
console.log(url);
},
function(error){
console.log(“error”);
});
};

try to add a timeout before the cordova.base64ToGallery function and I just look at your code maybe it was deprecated… can you look for new function about base64?

New function, is it something like the below code?

cordova.base64ToGallery(base64, {prefix:“img_”,mediaScanner:true},successFunc,failFunc);

It kept on crashing the app, so there is no possible way to test it. Probably there is, but I have limited knowledge on this matter. Can’t find any other codes, have I missed something?

hmm do you have a permission to access images(storage) already in your app??

I assumed I do, because at the beginning it asked for permission to access photo library. If it doesn’t, wouldn’t it say there is an error?

Just checked privacy setting, photos had other apps and their respected permission. The one I am working wasn’t there, also checked under the app name. Nothing on photos, does that mean I don’t have permission to use the gallery?

i think yes you don’t have the permission as a cause it forces you app to crash or exit…

1 Like

So what is it at the beginning when it asked for permission? :disappointed_relieved:

Anyway, thank you so much, that’s really helpful. Now just need to find out why.

check your app if it has permission in the device settings app… if not maybe it was the cause why your app was crashing…

Finally, found what it is needed to fix this problem.

Again, Thanks @anicacute09.

I’m glad that you fix it…

1 Like

Please Help
I am also facing the same issue…last time the code was working perfectly but Now not working…Don’t know what to do…stucked

This is my code

this.base64ToGallery.base64ToGallery(source, { prefix: '_imgx', mediaScanner: true }).then(
res => {});

Any update on this me to facing the same problem

Hi, have you guys solved the issue? I’m struggling. can you help?

I am also suffering from permission problem.I have taken permission using android permission but it does not work.When i manually disable and enable storage permission from permissions setting it starts to work well.Here is my code please help me.

  save(){
      var data = this.image.split('base64,')[1];
       this.base64ToGallery.base64ToGallery(data, { prefix: '_img',mediaScanner:true  }).then(
         res => this.presentAlertSaveSuccess(res),
         err => alert(err)
       );
     }

    
        checkStoragePermission(){
          this.androidPermissions.checkPermission(this.androidPermissions.PERMISSION.WRITE_EXTERNAL_STORAGE).then(
          result => {
            if (result.hasPermission) {
                this.save();
            } else {
              this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.WRITE_EXTERNAL_STORAGE).then(result => {
                if (result.hasPermission) {
                  this.save();
                }
              });
            }
          },
          err => this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.WRITE_EXTERNAL_STORAGE)
        );
        }
2 Likes

did you solve it? I have the same problem and I don’t know how to solve it.