Hi,
I’m trying to get my in app purchases up and running.
I have the following code:
[lua] print( "IN\_APP\_PURCHASES: initialize" ) if ( system.getInfo( "platformName" ) == "Android" ) then print( "here 1") store = require( "plugin.google.iap.v3" ) print( "here 2") InAppPurchases.currentProductList = InAppPurchases.googleProductList print( "here 3") -- store.init("google", InAppPurchases.transactionCallback) store.init(InAppPurchases.transactionCallback) print( "IN\_APP\_PURCHASES: store loaded for Google Play" ) elseif ( system.getInfo( "platformName" ) == "iPhone OS" ) then store = require( "store" ) InAppPurchases.currentProductList = InAppPurchases.appleProductList store.init("apple", InAppPurchases.transactionCallback) print( "IN\_APP\_PURCHASES: store loaded for iOS" ) else native.showAlert( "Notice", "In-app purchases are not supported in the Corona Simulator.", { "OK" } ) print( "IN\_APP\_PURCHASES: store not supported in this environment" ) end [/lua]
In the Android Debug Monitor I see that app has frozen at:
09-12 08:59:59.230: I/Corona(27640): IN_APP_PURCHASES: initialize
09-12 08:59:59.230: I/Corona(27640): here 1
09-12 08:59:59.230: V/Corona(27640): > Class.forName: plugin.google.iap.v3.LuaLoader
09-12 08:59:59.230: V/Corona(27640): < Class.forName: plugin.google.iap.v3.LuaLoader
09-12 08:59:59.230: V/Corona(27640): Loading via reflection: plugin.google.iap.v3.LuaLoader
09-12 08:59:59.240: I/Corona(27640): here 2
09-12 08:59:59.240: I/Corona(27640): here 3
Freeze happens here.
I was expecting to see: IN_APP_PURCHASES: store loaded for iOS right after “here 3”.
None of the 2 options work:
store.init(“google”, InAppPurchases.transactionCallback)
store.init(InAppPurchases.transactionCallback)
Please help,
Cheers, Radek