1

In my Ionic application I use the atob() command.

It works fine on chrome & android, but for some reason it does not work on iOS, is there an alternative?

Jon
  • 55
  • 5
  • Afaik iOS 7+ supports `atob`. If you are targeting devices with older OS you might consider to write include a polyfill https://github.com/davidchambers/Base64.js/ – Andreas Louv May 17 '16 at 13:09

1 Answers1

4

In IOS, atob does not accept space characters. So use atob like that:

var input = response.data.content;
input = input.replace(/\s/g, '');
var content = window.atob(input);

Have a look at that answer about atob

Community
  • 1
  • 1
ykaragol
  • 6,139
  • 3
  • 29
  • 56