AlobhaTechnologies / marketbilling

Automatically exported from code.google.com/p/marketbilling
0 stars 0 forks source link

Switching orientation whilst Purchase confirmation popup is active causes purchase to be cleared from the queue #183

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
STEPS TO REPRODUCE:
1. Make a call to GoogleIAB.consumeProduct()
2. Google Play purchase confirmation popup is shown
3. Change orientation
4. Proxy receives another call to purchase the same item again 
(launchPurchaseFlow) and clears out the queue
5. Google Play popup is closed by user (successful purchase or cancelled)
6. GoogleIABManager fires a purchaseFailedEvent regardless

EXPECTED OUTPUT:
Changing orientation doesn't call launchPurchaseFlow, so purchases are tracked 
properly.

ACTUAL OUTPUT:
Second call to proxy clears the queue and the GoogleIABManager reports that the 
purchase fails. As such it's not possible to tell whether the purchase 
succeeded or not and continue.

OS VERSION:
4.0.4

DEVICE:
Motorola XT910

OUTPUT FROM ADB BUGREPORT ATTACHED:
Yes

NOTES:
I've been able to easily reproduce this with the demo scene provided with the 
UnityPackage also

Original issue reported on code.google.com by matthew....@mediatonic.co.uk on 25 Mar 2014 at 7:36

Attachments:

GoogleCodeExporter commented 8 years ago
I've found a workaround for this for now, by forcing the activity to portrait 
orientation. Forcing to landscape doesn't solve the issue as locking the phone 
still causes the issue, presumably as the lock screen is portrait. I'd expect 
that if a device's lock screen has a landscape mode then this fix won't work.

The updated activity I'm now using in the manifest is as follows:
<activity android:name="com.prime31.GoogleIABProxyActivity" 
android:screenOrientation="portrait" 
android:configChanges="orientation"></activity>

Original comment by matthew....@mediatonic.co.uk on 26 Mar 2014 at 12:03

GoogleCodeExporter commented 8 years ago
I'd advise using the following attributes for this instead,

            android:screenOrientation="behind"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize"

Original comment by petetan...@gmail.com on 3 May 2014 at 7:39