2

I followed NativeScript's ImageSource module tutorial on how to save an image to the phone, but it's still not showing up on the phone's default gallery app.

Is there any way to tell the Image Module to save/add the picture to/into the phone's default gallery app?

Danziger
  • 19,628
  • 4
  • 53
  • 83
Jannomeister
  • 621
  • 4
  • 23

1 Answers1

3

If you are looking for something like:

imageSource.saveToGallery(name, extension);

I'm afraid there's nothing like that.

You will have to implement something custom for both Android and iOS to get the path to the gallery and save the image there.

Good news is there a plugin called nativescript-camera that has an option to save the pictures you take to the gallery, so that should serve you as inspiration to implement what you need. Particularly, these two files:

You could actually create and publish your own nativescript-gallery plugin to handle loading/saving images from/to the gallery!

Danziger
  • 19,628
  • 4
  • 53
  • 83