@Rob …still facing problem…
So, I write a sample code that have same problem. It is working fine with google reserved product ids ( android.test.purchased ) but not working real product ids…
Again I am sending log cat…hope it will help
E/PROXIMITY( 518): ProximitySensor: unknown event (type=3, code=0)
I/ActivityManager( 518): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=in.divum.birdninja/com.ansca.corona.CoronaActivity (has extras)} from pid 763
W/art ( 121): Could not get current activity
I/art ( 121): GcCauseExplicit concurrent mark sweep GC freed 584(24KB) AllocSpace objects, 0(0B) LOS objects, 5% free, 1459KB/1552KB, paused 5.275ms total 13.038ms
I/art ( 518): Heap trim of managed (duration=18.970231ms, advised=3MB) and native (duration=2.538077ms, advised=1344KB) heaps. Managed heap utilization of 59%.
I/ActivityManager( 518): Start proc in.divum.birdninja for activity in.divum.birdninja/com.ansca.corona.CoronaActivity: pid=13743 uid=10269 gids={50269, 3003}
W/linker (13743): liblua.so has text relocations. This is wasting memory and is a security risk. Please fix.
W/linker (13743): libjnlua5.1.so has text relocations. This is wasting memory and is a security risk. Please fix.
I/art (13743): Thread[1,tid=13743,WaitingForJniOnLoad,Thread*=0x41713080,peer=0x647c9af8,“main”] recursive attempt to load library “/data/app-lib/in.divum.birdninja-1/libjnlua5.1.so”
W/linker (13743): libopenal.so has text relocations. This is wasting memory and is a security risk. Please fix.
I/OpenAL_SLES(13743): alc_opensles_init
W/linker (13743): libmpg123.so has text relocations. This is wasting memory and is a security risk. Please fix.
W/linker (13743): libalmixer.so has text relocations. This is wasting memory and is a security risk. Please fix.
W/linker (13743): libcorona.so has text relocations. This is wasting memory and is a security risk. Please fix.
D/Sensors ( 518): activate handle =0, enable = 1
E/Sensors ( 518): handleToDriver handle(0)
D/Sensors ( 518): use new sensor index=2
D/Accel ( 518): ACC enable: handle:0, en:1
D/Accel ( 518): path:/sys/class/misc/m_acc_misc/accactive
D/Accel ( 518): ACC enable(1) done
E/Sensors ( 518): handleToDriver handle(0)
D/Accel ( 518): setDelay: (handle=0, ns=200000000)
E/Sensors ( 518): new setDelay handle(0),ns(200000000)m, error(0), index(2)
E/ (13743): appName=in.divum.birdninja, acAppName=/system/bin/surfaceflinger
E/ (13743): 0
I/MaliEGL (13743): [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL (13743): [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
I/MaliEGL (13743): [Mali]max_allowed_dequeued_buffers=3
D/OpenGLRenderer(13743): Enabling debug mode 0
E/ (13743): appName=in.divum.birdninja, acAppName=/system/bin/surfaceflinger
E/ (13743): 0
I/MaliEGL (13743): [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL (13743): [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
I/MaliEGL (13743): [Mali]max_allowed_dequeued_buffers=3
I/ActivityManager( 518): Displayed in.divum.birdninja/com.ansca.corona.CoronaActivity: +382ms
V/GLSurfaceView(13743): glGetString(7937) returns Mali-400 MP;
V/Corona (13743): > Class.forName: network.LuaLoader
V/Corona (13743): < Class.forName: network.LuaLoader
V/Corona (13743): Loading via reflection: network.LuaLoader
I/Corona (13743): Platform: Micromax AQ4501 / ARM Neon / 4.4.4 / Mali-400 MP / OpenGL ES 2.0 / 2014.2468
W/linker (13743): liblicensing.so has text relocations. This is wasting memory and is a security risk. Please fix.
V/Corona (13743): > Class.forName: CoronaProvider.licensing.google.LuaLoader
V/Corona (13743): < Class.forName: CoronaProvider.licensing.google.LuaLoader
V/Corona (13743): Loading via reflection: CoronaProvider.licensing.google.LuaLoader
V/Corona (13743): > Class.forName: plugin.google.iap.v3.LuaLoader
V/Corona (13743): < Class.forName: plugin.google.iap.v3.LuaLoader
V/Corona (13743): Loading via reflection: plugin.google.iap.v3.LuaLoader
D/Finsky (12444): [1625] InAppBillingUtils.pickAccount: in.divum.birdninja: Account determined from library ownership - [3Ak–rRd3VvyoLK35cP5TDy-ZIQ]
D/Finsky (12444): [1605] InAppBillingUtils.pickAccount: in.divum.birdninja: Account determined from library ownership - [3Ak–rRd3VvyoLK35cP5TDy-ZIQ]
D/Finsky (12444): [1604] InAppBillingUtils.pickAccount: in.divum.birdninja: Account determined from library ownership - [3Ak–rRd3VvyoLK35cP5TDy-ZIQ]
E/IABUtil/Security(13743): Purchase verification failed: missing data.
W/IabHelper(13743): In-app billing warning: Purchase signature verification **FAILED**. Not adding item.
W/System.err(13743): com.naef.jnlua.LuaRuntimeException: ?:0: attempt to get length of field ‘products’ (a nil value)
W/System.err(13743): at com.naef.jnlua.LuaState.lua_pcall(Native Method)
W/System.err(13743): at com.naef.jnlua.LuaState.call(Unknown Source)
W/System.err(13743): at com.ansca.corona.CoronaLua.dispatchEvent(CoronaLua.java:100)
W/System.err(13743): at plugin.google.iap.v3.ProductListRuntimeTask.executeUsing(ProductListRuntimeTask.java:119)
W/System.err(13743): at com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:148)
W/System.err(13743): at com.ansca.corona.events.EventManager.sendEvents(EventManager.java:87)
W/System.err(13743): at com.ansca.corona.Controller.updateRuntimeState(Controller.java:281)
W/System.err(13743): at com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:417)
W/System.err(13743): at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1622)
W/System.err(13743): at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1377)
E/PROXIMITY( 518): ProximitySensor: unknown event (type=3, code=0)
E/PROXIMITY( 518): ProximitySensor: unknown event (type=3, code=0)
I/art ( 8908): Heap trim of managed (duration=2.934077ms, advised=476KB) and native (duration=2.528770ms, advised=140KB) heaps. Managed heap utilization of 71%.
E/PROXIMITY( 518): ProximitySensor: unknown event (type=3, code=0)
E/PROXIMITY( 518): ProximitySensor: unknown event (type=3, code=0)
E/PROXIMITY( 518): ProximitySensor: unknown event (type=3, code=0)
E/PROXIMITY( 518): ProximitySensor: unknown event (type=3, code=0)
I/Corona (13743): PURCHASING>>>>>>>>>>
D/Finsky (12444): [1625] InAppBillingUtils.pickAccount: in.divum.birdninja: Account determined from library ownership - [3Ak–rRd3VvyoLK35cP5TDy-ZIQ]
I/ActivityManager( 518): START u0 {cmp=com.android.vending/com.google.android.finsky.billing.lightpurchase.IabV3Activity (has extras)} from pid -1
D/Sensors ( 518): activate handle =0, enable = 0
E/Sensors ( 518): handleToDriver handle(0)
D/Sensors ( 518): use new sensor index=2
D/Accel ( 518): ACC enable: handle:0, en:0
D/Accel ( 518): path:/sys/class/misc/m_acc_misc/accactive
D/Accel ( 518): ACC enable(0) done
D/Finsky (12444): [1] CarrierParamsAction.createCarrierBillingParameters: Carrier billing config is null. Device is not targeted for DCB 2.
E/Finsky (12444): [1630] FileBasedKeyValueStore.delete: Attempt to delete ‘paramsmN9bYH2z22O_zZxyArmUgA’ failed!
I/MaliEGL (12444): [Mali]window_type=1, is_framebuffer=0, errnum = 0
I/MaliEGL (12444): [Mali]surface->num_buffers=4, surface->num_frames=3, win_min_undequeued=1
I/MaliEGL (12444): [Mali]max_allowed_dequeued_buffers=3
I/art ( 518): Heap trim of managed (duration=25.795461ms, advised=3MB) and native (duration=2.725846ms, advised=1360KB) heaps. Managed heap utilization of 58%.
I/ActivityManager( 518): Displayed com.android.vending/com.google.android.finsky.billing.lightpurchase.IabV3Activity: +231ms
I/qtaguid (12444): Failed write_ctrl(u 47) res=-1 errno=22
I/qtaguid (12444): Untagging socket 47 failed errno=-22
W/NetworkManagementSocketTagger(12444): untagSocket(47) failed with errno -22
E/Volley (12444): [1614] BasicNetwork.performRequest: Unexpected response code 500 for https://android.clients.google.com/fdfe/preparePurchase
D/Finsky (12444): [1] PurchaseFragment.handleError: Error: PurchaseError{type=2 subtype=0}
D/Finsky (12444): [1] PurchaseFragment.fail: Purchase failed: PurchaseError{type=2 subtype=0}
E/PROXIMITY( 518): ProximitySensor: unknown event (type=3, code=0)
E/PROXIMITY( 518): ProximitySensor: unknown event (type=3, code=0)
D/lights ( 518): write_int open fd=156
D/lights ( 518): write_int open fd=156
D/lights ( 518): write_int open fd=156
D/lights ( 518): write_int open fd=156
D/lights ( 518): write_int open fd=156
D/lights ( 518): write_int open fd=156
D/lights ( 518): write_int open fd=156
D/lights ( 518): write_int open fd=156
D/lights ( 518): write_int open fd=156
E/PROXIMITY( 518): ProximitySensor: unknown event (type=3, code=0)
E/PROXIMITY( 518): ProximitySensor: unknown event (type=3, code=0)
D/Sensors ( 518): activate handle =0, enable = 1
E/Sensors ( 518): handleToDriver handle(0)
D/Sensors ( 518): use new sensor index=2
D/Accel ( 518): ACC enable: handle:0, en:1
D/Accel ( 518): path:/sys/class/misc/m_acc_misc/accactive
D/Accel ( 518): ACC enable(1) done
E/Sensors ( 518): handleToDriver handle(0)
D/Accel ( 518): setDelay: (handle=0, ns=200000000)
E/Sensors ( 518): new setDelay handle(0),ns(200000000)m, error(0), index(2)
E/PROXIMITY( 518): ProximitySensor: unknown event (type=3, code=0)
E/PROXIMITY( 518): ProximitySensor: unknown event (type=3, code=0)
E/PROXIMITY( 518): ProximitySensor: unknown event (type=3, code=0)
E/PROXIMITY( 518): ProximitySensor: unknown event (type=3, code=0)
D/lights ( 518): write_int open fd=148
D/lights ( 518): write_int open fd=148
D/lights ( 518): write_int open fd=148
E/PROXIMITY( 518): ProximitySensor: unknown event (type=3, code=0)
Sethuramans-Mac-mini:platform-tools sethuramanvaideeswaran$
And sample code is as follows
–
– main.lua
–
– Your code here
local store
local v3 = false
local currentProductList = nil
local appleProductList = {
“com.domainname.ExampleInAppPurchase.ConsumableTier1”,
“com.domainname.ExampleInAppPurchase.NonConsumableTier1”,
“com.domainname.ExampleInAppPurchase.SubscriptionTier1”
}
local googleProductList = {
– these product IDs are for testing and are supported by all Android apps
“in.divum.birdninja.zappybird”,
“in.divum.birdninja.rorobird”,
“in.divum.birdninja.250lives”
}
local function storeTransaction( event )
local transaction = event.transaction
if ( transaction.state == “purchased” ) then
print(“handle a successful transaction here”)
elseif ( transaction.state == “refunded” ) then
--refunds are only supported by the Google Play Marketplace
print( “productIdentifier”, transaction.productIdentifier )
end
store.finishTransaction( event.transaction )
end
if ( system.getInfo( “platformName” ) == “Android” ) then
store = require( “plugin.google.iap.v3” )
v3 = true
currentProductList = googleProductList
store.init( “google”, storeTransaction )
elseif ( system.getInfo( “platformName” ) == “iPhone OS” ) then
store = require( “store” )
currentProductList = appleProductList
store.init( “apple”, storeTransaction )
else
native.showAlert( “Notice”, “In-app purchases are not supported in the Corona Simulator.”, { “OK” } )
end
local function loadProductsCallback( event )
local validProducts = event.products
local invalidProducts = event.invalidProducts
print( “Valid Products:”, #validProducts )
for i = 1,#validProducts do
local currentItem = validProducts[i]
print( currentItem.title )
print( currentItem.description )
print( currentItem.price )
print( currentItem.productIdentifier )
end
print( “Invalid Products:”, #invalidProducts )
for i = 1,#invalidProducts do
print( invalidProducts[i] )
end
end
if ( store.isActive ) then
if ( store.canLoadProducts ) then
store.loadProducts( arrayOfProductIdentifiers, loadProductsCallback )
else
print(“this store does not support an app fetching products”)
end
end
timer.performWithDelay(6000, function(e)
print(“PURCHASING>>>>>>>>>>”)
store.purchase( “in.divum.birdninja.zappybird” )
end)
Thanks in Advance