TeraMantis
TeraMantis

Reputation: 41

How to get callback after in app purchase in CodenameOne

My application can buy in-app products from Play store and itunes.

However I would like to get notification that the payment was successful.

How can I achieve this? Currently the product is bought and that is all.

I know that there is a PurchaseCallback interface which can be implemented but the paymentSucceeded() method is for manual payments.

Sample scenario:

I buy the product from store, then I listen for success response. Then based on response. Display something or do something.

Upvotes: 0

Views: 157

Answers (1)

Shai Almog
Shai Almog

Reputation: 52770

You get the callback itemPurchased(String s) with the appropriate SKU when the payment succeeds. You can test this in the simulator where you get the appropriate prompts.

Upvotes: 1

Related Questions