IAP info pops up under monkeygame

Monkey Targets Forums/Android/IAP info pops up under monkeygame

pantson(Posted 2014) [#1]
Hi
I've followed all the guides (and copied code) on the forums.
In each case my monkeygame stops responding once you purchase an IAP item. Once I press Yes to close, the Google Wallet popup is beneath the monkeygame app.

Is this normal behaviour? I dont see anyone else mentioning this.

I have followed guides by Xaron (many thanks btw) and keep getting the same "feature"

many thanks


Xaron(Posted 2014) [#2]
Could you explain a bit more what you did? The Google Wallet pops up indeed as soon as you do a purchase. It should close after doing (or canceling) the purchase.


pantson(Posted 2014) [#3]
I'll get the relevant code and screenshots up later... ta

I assume the wallet window appears above the monkeygame and game carries on beneath?


pantson(Posted 2014) [#4]
Hi
I've finally manged to get an error in the logs
I/[Monkey](17709): shop open
E/AndroidRuntime(17709): FATAL EXCEPTION: main
E/AndroidRuntime(17709): java.lang.RuntimeException: Store currently busy
E/AndroidRuntime(17709): 	at com.appytimes.gpcz.bb_std_lang.error(MonkeyGame.java:145)
E/AndroidRuntime(17709): 	at com.appytimes.gpcz.c_MonkeyStore.p_BuyProductAsync(MonkeyGame.java:6831)
E/AndroidRuntime(17709): 	at com.appytimes.gpcz.c_shopper.p_BuyProduct(MonkeyGame.java:5917)
E/AndroidRuntime(17709): 	at com.appytimes.gpcz.c_myApp.p_OnUpdate(MonkeyGame.java:5022)
E/AndroidRuntime(17709): 	at com.appytimes.gpcz.c_GameDelegate.UpdateGame(MonkeyGame.java:5428)
E/AndroidRuntime(17709): 	at com.appytimes.gpcz.BBGame.UpdateGame(MonkeyGame.java:568)
E/AndroidRuntime(17709): 	at com.appytimes.gpcz.BBAndroidGame.UpdateGame(MonkeyGame.java:1271)
E/AndroidRuntime(17709): 	at com.appytimes.gpcz.BBAndroidGame$GameTimer.run(MonkeyGame.java:823)
E/AndroidRuntime(17709): 	at android.os.Handler.handleCallback(Handler.java:730)
E/AndroidRuntime(17709): 	at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime(17709): 	at android.os.Looper.loop(Looper.java:176)
E/AndroidRuntime(17709): 	at android.app.ActivityThread.main(ActivityThread.java:5419)
E/AndroidRuntime(17709): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(17709): 	at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime(17709): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
E/AndroidRuntime(17709): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
E/AndroidRuntime(17709): 	at dalvik.system.NativeStart.main(Native Method)
E/android.os.Debug( 2362): !@Dumpstate > sdumpstate -k -t -z -d -o /data/log/dumpstate_app_error
E/        (17534): Device driver API match
E/        (17534): Device driver API version: 23
E/        (17534): User space API version: 23 
E/        (17534): mali: REVISION=Linux-r3p2-01rel3 BUILD_DATE=Wed Oct  9 21:05:57 KST 2013 
E/Finsky  (17534): [8068] FileBasedKeyValueStore.delete: Attempt to delete 'paramsOUJbxt9ZVx5nRI2zmgrddQ' failed!
E/OpenGLRenderer( 3891): SFEffectCache:clear(), mSize = 0
E/OpenGLRenderer( 3891): SFEffectCache:clear(), mSize = 0
E/OpenGLRenderer( 3891): SFEffectCache:clear(), mSize = 0
E/Watchdog( 2362): !@Sync 850
E/SQLiteLog(18739): (1) duplicate column name: extraData
E/BadgeProvider(18739): onUpgarde :: Trying to add Column :: Exception already exists:duplicate column name: extraData (code 1): , while compiling: ALTER TABLE apps ADD COLUMN extraData TEXT DEFAULT base_extra_badge;
E/ViewRootImpl( 2362): sendUserActionEvent() mView == null
E/EnterpriseContainerManager( 2362): ContainerPolicy Service is not yet ready!!!
E/Watchdog( 2362): !@Sync 851


Just trying to read it myself to see what the score is
Devices are S3 and Sony Xperia Play


pantson(Posted 2014) [#5]
i wonder if it because Ive made my code too complicated.
What I have done, is wrapped variations of the iaptest.monkey and your code into another class. so that I can call store = new shopper
The shopper class extends the brl instances and not the main game.

I'm gong to test the simple iaptest and your code on their own to see if its me (and probably is)


pantson(Posted 2014) [#6]
found it!
 java.lang.RuntimeException: Store currently busy

It does what it says on the tin ;-)

Added another if not store.IsBusy() check. All fixed!


therevills(Posted 2014) [#7]
Added another if not store.IsBusy() check. All fixed!

Hey Rich - where did you add this?


pantson(Posted 2014) [#8]
my buyproduct function didn't check to see if the store was busy before buying something.
Looks like 2 calls to buyproduct in a row, without completing the first crashed the game

new code...
Method BuyProduct:Int(product:String)
	If Not IsBusy()
		For Local p:=Eachin store.GetProducts()
			If p.Identifier = product
				store.BuyProductAsync p,Self
				Return True
			End
		Next
	End
	Return False
End