Hi @mitch-596c01! Could you provide debug logs as well as a snippet of your implementation code? Also, are you using a sandbox user or StoreKit (docs)?
Hey @jeffrey_bunn
Thanks for the reply, there aren’t any error logs when I try and make purchase. I can post all the configure and signing a user in, and getting the offerings if you think that would be helpful. I’m using a sandbox user on a physical device. I tried StoreKit with an emulator but had the same issue.
Here are the code snippets of the implementation:
Created function on the component:
async created() {
if (this.isNativePlatform()) {
try {
this.isLoadingOffering = true;
const offerings = await Purchases.getOfferings();
this.isLoadingOffering = false;
if (offerings.current !== null && offerings.current.availablePackages.length !== 0) {
this.offerings = offerings.current.availablePackages;
this.selectedPackageToBuy = offerings.current.availablePackagesa0];
}
await Purchases.addCustomerInfoUpdateListener((customerInfo) => {
this.customerInfo = customerInfo;
});
} catch (error) {
this.isLoadingOffering = false;
}
}
},
Make purchase function on the button on click:
makePurchase() {
console.log('makePurchase');
this.isLoading = true;
Purchases.purchasePackage({ aPackage: this.selectedPackageToBuy })
.then(() => {
console.log('makePurchase then');
this.getUserMethod();
})
.catch((error) => {
console.log('Purchases.purchasePackage error');
console.log(error);
this.isLoading = false;
});
},
The Purchases.purchasePackage function never resolves
!-->