Is atob available in javascript with iOS preview app?

Hello, any idea why the atob would not work / be available in javascript with iOS preview app ?
if tested as a web app it does work on iOS. The below code snippet demonstrates the problem. The console.log is never reached and the exception raised does not give much insight into the root cause of the problem; Thx;

const bytes = atob(json.image)
  .split('')
  .map(c => c.charCodeAt(0));
console.log('bytes: ', bytes.length)

Hi @Piotr_Tesny, the mobile apps are built with React Native, which uses Node.js as a runtime to build the JavaScript code. Node.js doesn’t have support for atob and btoa. The web app JavaScript runtime is implemented by the browser, where the functions are supported.

Many thanks. Is there a way to work around it? Like using the nodejs Buffer interface ? thx;

I found a sort of a workaround… React Native atob() / btoa() not working without remote JS debugging - Stack Overflow

but the blob URL on a mobile device is not an URL:
blob:818c9dbb-1320-4c13-95c7-e1d48749eee6?offset=0&size=123128

what do I do with this blob ? where is it stored ? @Mari , any idea? Thx;

PS. here is the blob URL (redacted) generated in a browser:
blob:https://platform.preview.appgyver.com/34e8370f-119a-40a8-99a3-9109098xxxxx

FYI: I found out how to read/convert the RN blob image back into base64 encoded image string: javascript - How to display blob image in react native - Stack Overflow ; So the remaining question is how do I use it with a let’s say page variable to be bound with an image? Any ideas? Thx;

Hi, if you have the base64 string as an output of the Custom JS flow, you can follow that with a “Set page variable” flow where you set the output of the previous node as the value of the variable. Then use a page variable binding for the image source.