I have:
- configured subscriptions
- 2 products each 2 base plans - every plan is active
- license testers
- internal track testers
- have the same build number in internal track as in my Android studio
- I did release build and installed it to my device via
adb - same signing keys
- I can list my subscriptions by providing skus
But unfortunately, I still can't get over the error when doing purchase:
error {
"message": "That item is unavailable.",
"debugMessage": "",
"code": "E_ITEM_UNAVAILABLE",
"responseCode": 4
}
I'm using react-native-iap library and this is my code(simplyfied):
const {subscriptions, currentPurchase, finishTransaction, getSubscriptions, getPurchaseHistory} = useIAP()
const subscribe = async (productId: string, offerToken: string) => {
console.log('product id', productId, 'offertoken', offerToken)
try {
await requestSubscription({
sku: productId,
...(offerToken && {
subscriptionOffers: [{sku: productId, offerToken}],
}),
})
} catch (err: any) {
console.warn(err.code, err.message)
}
}
useEffect(() => {
const subscription = purchaseUpdatedListener((purchase: Purchase) => {
console.log('purchase', JSON.stringify(purchase, null, 2))
})
return () => {
subscription.remove()
}
}, [])
useEffect(() => {
const subscription = purchaseErrorListener((error: PurchaseError) => {
console.log('error', JSON.stringify(error, null, 2))
})
return () => {
subscription.remove()
}
}, [])
const finish = () => {
if (currentPurchase) {
finishTransaction({purchase: currentPurchase, isConsumable: false})
}
}
...
{subscriptions.map((subscription) =>
subscription.subscriptionOfferDetails.map((offer) => (
<Text
key={offer.basePlanId}
onPress={() => subscribe(subscription.productId, offer.offerToken)}
>
{subscription.name}
</Text>
)),
)}
- Do I have to release app to closed testing to be able to proceed with testing?
- Do I have something misconfigured?
Any tips&tricks welcomed
...well...I found it (☝ ՞ਊ ՞)☝ ... in 2023 for testing subscription for Android you need these boxes to be ticked:
your-app.aabuploaded to internal tracknot needed:
your-app.aabin store