Closed RazaShehryar closed 3 years ago
Hello,
I am facing issue with the .init function as whenever I try to write it in the App.js, it gives me an error "undefined is not a function". I am using react-native-iap 5.1.1 version. Here's the code.
useEffectAsync(async () => { try { await Iaphub.init({ appId: APP_ID, apiKey: CLIENT_KEY, environment: "production", }); await Iaphub.setUserId(DeviceInfo.getUniqueId()); } catch (e) { console.log(e); } }, []);
Let me know if there's something wrong that I am doing.
Nevermind, I was defining it as import * as Iaphub from 'react-native-iaphub'. It should have been import Iaphub from 'react-native-iaphub'.
Closing this issue now.
Hello,
I am facing issue with the .init function as whenever I try to write it in the App.js, it gives me an error "undefined is not a function". I am using react-native-iap 5.1.1 version. Here's the code.
useEffectAsync(async () => { try { await Iaphub.init({ appId: APP_ID, apiKey: CLIENT_KEY, environment: "production", }); await Iaphub.setUserId(DeviceInfo.getUniqueId()); } catch (e) { console.log(e); } }, []);
Let me know if there's something wrong that I am doing.