WinPhone: IAP not working?

Monkey Forums/Monkey Bug Reports/WinPhone: IAP not working?

dragon(Posted 2014) [#1]
I tested my code on Android - and it worked fine...
On WinPhone, i found a problem with this line:

store.OpenStoreAsync(Self)

i do not know what is wrong with it
when i comment it out, all is fine...
but store is not working then

VS2012 message:
First-chance exception at 0x77B81EDB in TaskHost.exe: Microsoft C++ exception: Platform::COMException ^ at memory location 0x0573F750. HRESULT:0x805A0194

this error comes direct at start...
if i start my game on phone - here is no crash or something,
but store is not opened then...


my code is nearly the same sample code:

	Method InitPurchases:Void ()
		LoadPurchases()
		store = New MonkeyStore()
		store.AddProducts(["pay_1"], 1)
		store.OpenStoreAsync(Self) '<<<<<PROBLEM
	End



i started my app from VS2012 - instead downloading beta app from store
or do i need something else?

SCREENSHOT:
http://www.pasteall.org/pic/show.php?id=70787


Xaron(Posted 2014) [#2]
Had the same issue and gave up...

http://www.monkey-x.com/Community/posts.php?topic=8343


dragon(Posted 2014) [#3]
hi

i had success with my beta app!
after i uploaded it - and downloaded (signed app) on phone,
i could open the store and buy something...

my app started from VS2012 do not worked....


on android i do not need to upload and download my app...


Xaron(Posted 2014) [#4]
Well that's interesting! Thanks for sharing! :)


dragon(Posted 2014) [#5]
strange... i did nothing... and started my app 2 hours later, and it do not start anymore...
i reinstalled it... nothing helps...


dragon(Posted 2014) [#6]
i noticed, that...
if here is something wrong with store, the app exits directly...
because here are many ERROR-commands in monkeystore...

HELL!
if store is unavailable, my app should never quit!!!
it should simply ignore this...

(but i see no error message)

	Method BuyProductAsync:Void( product:Product,onComplete:IOnBuyProductComplete )
		If _state<0 Error "Store unavailable"
		If _state=0 Error "Store not open"
		If _state<>1 Error "Store currently busy"
...



marksibly(Posted 2014) [#7]
> Had the same issue and gave up...

You have to click 'continue' here - as far as I can tell, it's just the way msvc/winrt works. See my reply to your bug report for more info. Note that this only happens when you run the app from msvc.

> if here is something wrong with store, the app exits directly...

Do NOT use BuyProductAsync if store did not open correctly!


dragon(Posted 2014) [#8]
LoadPurchases not worked for me...
need to check why...


Xaron(Posted 2014) [#9]
Interesting. Please keep us posted what's wrong there!


dragon(Posted 2014) [#10]
i found out, that following line crash my app:

purchases = New JsonObject(json)


it seems that deinstalling and installing again do not help to remove saved data
i need to check what is wrong with saved json string...

i tested with a smaller sample code - but it worked fine (installed from VS and not from store).


dragon(Posted 2014) [#11]
my json string is
{"pay_1":2}

it do not look corrupt...
i checked for unicode etc... it is pure ascii without any control chars...
but this command fail to load and crash:

purchases = New JsonObject(json)



i decided to do not use JsonObject
and save purchases with SaveState...

this should fix it for me...
i do not know, why this happen...