skip to Main Content

I'm getting 'undefined is not an object (near '…}).fs.writeFile(' when trying to download base64 image png in react native React Native

Here is my code: const saveImg = async (base64Img: string, success: Function, fail:Function) => { const isAndroid = Platform.OS === "android" const isIos = Platform.OS === 'ios' const dirs = isIos? RNFS.LibraryDirectoryPath : RNFS.ExternalDirectoryPath; const certificateTitle = 'certificate-'+((Math.random() * 10000000)…

VIEW QUESTION

How to Properly return a Promise in TypeScript? – React native

I have the following code: import {initConnection,IapIosSk2, setup} from "react-native-iap" async nativeTest() : Promise<ProductStatus[]>{ try { let stat: Promise<ProductStatus[]> = await (IapIosSk2).subscriptionStatus('sku') setup({storekitMode:'STOREKIT2_MODE'}) initConnection() return await new Promise((resolve, reject) => { if (stat) { for (let data in stat){ console.log(data)…

VIEW QUESTION
Back To Top
Search