Hello,
I am using the ionic sdks. However for some reason i get the error
“There is no singleton instance. Make sure you configure Purchases before trying to get the default instance.”
I am using the code below and as you can see I am calling Purchases.configureWith before Purchases.getCustomerInfo(). But not sure why I am getting this error?
Can anyone guide as what I am doing wrong?
Also attaching screen of my console
Purchases.setDebugLogsEnabled(true);
if (context.user) {
console.log("before configure");
Purchases.configureWith({
// @ts-ignore
apikey: import.meta.env.VITE_RC_ANDROID_KEY,
appUserID: context.user,
});
console.log("after configure");
try {
console.log("before customerinfo");
const customerInfo = await Purchases.getCustomerInfo();
console.log("after customerinfo");
console.log(customerInfo);
} catch (e) {
console.log(e);
}
}
}