Closed kayro2222 closed 1 year ago
Since you are using Storekit 2. You can try await IapIosSk2.latestTransaction(sku)
it worked @andresesfm! thanks for your time.
hey @andresesfm, I'm receiving [Error: Can't find product for sku **my_sku**]
using IapIosSk2.latestTransaction(skus.monthly)
when I reload my app. At fast refresh, I'm able to get the subscriptions. I'm still able to purchase the subscription with
await requestSubscription({
sku: selectedSubscription?.productId,
})
Other problem that I'm seeing, is that this function IapIosSk2.subscriptionStatus(skus.monthly)
always returns expired [{"state": "expired"}]
it seems that I need to use the context hook at the purchase history too. I can't let my own context handle this.
I'm trying to get the user's purchases with
getPurchaseHistory()
andgetAvailablePurchases()
to verify if the user has active subscription to send him to the main navigator of the app or to the subscription offers. The functions are returning an undefined value or an empty array.Expected behavior
I need to get the history of purchases to validate if the date is expired or not. Using the version 10.0.6, I had successfully get the history using the methods described above.
Screenshots
Environment:
To Reproduce Steps to reproduce the behavior:
I'm requesting the purchase using the examples provided from the lib:
But when I reload the app, I want to verify if this subscription is active using:
My logs:
[Optional] Additional Context
I'm using
setup({ storekitMode: 'STOREKIT2_MODE' })
I do not save the purchase information at my server-side.