AndroidInAppPurchase icon indicating copy to clipboard operation
AndroidInAppPurchase copied to clipboard

How to get a login page to appear if the account hasn't been logged in?

Open sikfreeze opened this issue 11 years ago • 2 comments

I've added In-App billing function to my application using your ANE. The flow for the purchases when the users have already been logged-in to their account on their phones are working fine. However, if they haven't been logged in to their account prior to the app initialization, they will only get purchase failure. Is it possible to get the log in page to appear so that they can continue with their purchases?

sikfreeze avatar Feb 27 '14 10:02 sikfreeze

ANE behaves the same way as Android In-App written in Java, so read docs.

pozirk avatar Feb 27 '14 14:02 pozirk

@sikfreeze I handled the InAppPurchaseEvent.INIT_ERROR and used a boolean that controls if the phone has a Google Account on it or not... When the user try to buy something, i verify this boolean and if its false I show an alert saying: "You must have a Google Account associated with this device before trying to buy any in app purchase!"... Also, it's a good practice to have a hook on nativeApplication for the flash.events.Event.ACTIVATE and call the InAppPurchase.init() again, just in case the user switch to Settings, add an account and return to your app! Good luck!

lzaiats avatar May 29 '14 12:05 lzaiats