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

Keep valid SKUs in memory #602

Merged
merged 1 commit into from
Jul 19, 2019
Merged

Keep valid SKUs in memory #602

merged 1 commit into from
Jul 19, 2019

Conversation

huttj
Copy link
Contributor

@huttj huttj commented Jul 18, 2019

I get an error when trying to purchase a product after calling getSubscriptions(subSkus) and getProducts(productSkus), like so:

const subscriptions = await RNIap.getSubscriptions(subscriptionIds);
const products = await RNIap.getProducts(productIds);

This seems to be because both call RNIapModule.getItemsByType(), which replaces the internal SKUs cache. The only way to get it to work without making this change is to call the getProducts() or getSubscriptions() before trying to purchase.

Don't drop previously retrieved SKUs when calling `getItemsByType` a second time.
@hyochan hyochan added 🛠 bugfix All kinds of bug fixes 🍗 enhancement New feature or request labels Jul 19, 2019
Copy link
Owner

@hyochan hyochan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Much better to handle the side effect!

@hyochan hyochan merged commit 9235cb4 into hyochan:master Jul 19, 2019
@huttj huttj deleted the patch-1 branch July 19, 2019 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠 bugfix All kinds of bug fixes 🍗 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants