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

Allow products to be fetched even if purchases are restricted #123

Merged
merged 1 commit into from
Sep 27, 2017

Conversation

akshetpandey
Copy link
Contributor

Restricting IAPs doesn't prevent us from fetching product information. A better way to handle this is to check canMakePayments method and show appropriate message on the payment screen.

@chirag04
Copy link
Owner

i guess this is fine but at the same time we should update the purchaseProduct calls to check if they can make payments.

@akshetpandey
Copy link
Contributor Author

It will error out both ways, so doesn't really make a difference in result.

@chirag04
Copy link
Owner

difference being you will get a clear "not_available" error callback to handle it in the js. at the very least we should call out in the docs for buy products to check for payments before making a purchaseProduct request.

@akshetpandey
Copy link
Contributor Author

Fair enough, let me make that change.

@chirag04
Copy link
Owner

i think it's a reasonable pattern to ask for users to check first. so let's just update the docs only.

@akshetpandey
Copy link
Contributor Author

Added README changes

Readme.md Outdated
### Checking if payments are allowed

```javascript
InAppUtils.canMakePayments((canMakePayments, error) => {
Copy link
Owner

Choose a reason for hiding this comment

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

remove error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤦‍♂️ Oops...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Restricting IAPs doesn't prevent us from fetching product information. A better way to handle this is to check canMakePayments method and show appropriate message on the payment screen.

Update README to include canMakePayments

Also add note about calling canMakePayments before purchaseProduct to show a better error message to users.
Copy link
Owner

@chirag04 chirag04 left a comment

Choose a reason for hiding this comment

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

will ship tomorrow.

@chirag04 chirag04 merged commit 6bf387b into chirag04:master Sep 27, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants