Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getAvailablePurchases() method not working with auto-renewable subscriptions in iOS StoreKit 2 mode #2851

Open
nahlebn1k opened this issue Sep 20, 2024 · 4 comments

Comments

@nahlebn1k
Copy link

Please use the Discussion board if you want to get some help. Please use issues to report bugs.

Description

Hello, i found out that getAvailablePurchases() method not working with auto-renewable subscriptions in iOS StoreKit 2 mode and returns empty array. I tried to debug swift native code with this method and found next error. productStore.getProduct() verification not working with auto-renewable subscriptions.

Expected Behavior

getAvailablePurchases() method should return array of current user subscriptions.

Screenshots

telegram-cloud-photo-size-2-5436003681662262592-y
telegram-cloud-photo-size-2-5436003681662262596-y

Environment:

  • react-native-iap: 12.14.0
  • react-native: 0.74.1
  • Platforms (iOS, Android, emulator, simulator, device): iOS

To Reproduce
Steps to reproduce the behavior:

Use getAvailablePurchases() method with active subscription in iOS StoreKit 2 mode


[Optional] Additional Context

@nahlebn1k
Copy link
Author

nahlebn1k commented Sep 20, 2024

I discovered that getAvailablePurchases() on ios works, BUT only after fetching all products from App Store. I don't think that is approach is best in this case. Also Android works without fetching products.

@wallinex
Copy link

I have the same issue.

@mobilesmartdev
Copy link

I have the same issue. Did anyone got any solution to it?

@nahlebn1k
Copy link
Author

nahlebn1k commented Nov 6, 2024

@mobilesmartdev In my current workaround i parse all existing in-app products and subscriptions with getSubscriptions() and getProducts() methods on the app launch. After this getAvailablePurchases() method works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants