0

I'm using Ionic 4 (4.12.0) with the PhotoViewer plugin versions:

"@ionic-native/photo-viewer": "^5.21.5",
"com-sarriaroman-photoviewer": "^1.2.4",

And the code is:

 public presentImage(imgSrc): void {
    this.photoViewer.show(imgSrc, '', {
      share: false,
      closeButton: true,
      copyToReference: true
    });
  }

The variable imgSrc is a base64. If I remove the options, the photoViewer opens with a black screen, but with the options it's crashing the app. But as the title states, it only happens on iOS.

1 Answers1

1

after read the document, base64 is just supported on android. So it is what the problem. (1.1.4) Base64 Support on Android

Khanh Le Tran
  • 860
  • 4
  • 15
  • 1
    And what do you recommend me using? Because we make the call to the backend which send us the image in a BLOB format and we convert it to base64 to show both on HTML and through the plugin when clicked. – Yuri Galiza Feb 24 '20 at 12:50
  • use can use tag to show base64 string like this: `data:image/jpeg;base64,' + base64String` and assign for src attribute – Khanh Le Tran Feb 26 '20 at 02:46