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

Add support for iOS In-App Purchase promotions #388

Merged
merged 3 commits into from
Jan 30, 2019

Conversation

neilco
Copy link
Contributor

@neilco neilco commented Jan 29, 2019

This pull request adds support for the additional SKProductTransactionObserver delegates that support promoting In-App Purchase products in the App Store.

This pull request closes #199.

index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Show resolved Hide resolved
@hyochan hyochan added the 🎯 feature New feature label Jan 29, 2019
@hyochan
Copy link
Owner

hyochan commented Jan 29, 2019

@neilco Thank you for the contribution. This is really great support!. I've reviewed some of your lines.

@neilco
Copy link
Contributor Author

neilco commented Jan 30, 2019

@hyochan Thanks for the comments. This is ready for review again. 👍

@neilco
Copy link
Contributor Author

neilco commented Jan 30, 2019

@hyochan I’ve spotted an issue related to the React Native app lifecycle—if the app is terminated and a promoted product is clicked in the App Store, the app will open but will never receive the PROMOTED_PRODUCT event. This is because the SKPaymentTransactionObserver delegate is called before React Native has had a chance to add any listeners. I’m testing a solution now.

@neilco
Copy link
Contributor Author

neilco commented Jan 30, 2019

@hyochan All ready for review 🙈

@hyochan hyochan merged commit 03b3d86 into hyochan:master Jan 30, 2019
@kristfal
Copy link
Contributor

Question for this: How would one go about getting the full receipt for a promoted product after the purchase? This is relevant for receipt validation.

@neilco
Copy link
Contributor Author

neilco commented Feb 22, 2019

@kristfal Purchased promoted products are the same as regular purchases so handle the receipt in exactly the same way.

@kristfal
Copy link
Contributor

kristfal commented Feb 22, 2019

Ok, thanks for info. Reason I was asking is because the return value of buyPromotedProduct is not documented. Is it of type <Purchase> (same as buyProduct/buySubscription)?

@neilco
Copy link
Contributor Author

neilco commented Feb 23, 2019

@kristfal buyPromotedProduct returns a Promise that is resolved with a subset of the purchase data, including the transaction receipt. This is exactly the same as buyProduct and buySubscription.

The only difference is that the product choice happens external to the app—the IAPPromotedProductObserver receives a SKProduct and SKPayment from the App Store and buyPromotedProduct adds that SKPayment to the SKPaymentQueue.

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

Successfully merging this pull request may close these issues.

Promote IAPs from App Store?
3 participants