local store = require( “store” )
store.init( “apple”, storeTransaction )
local myText = display.newText( “Click”, 100, 200, native.systemFont, 16 )
myText:setFillColor( 1, 0, 0 )
local myText1 = display.newText( " Purchase Work", 200, 200, native.systemFont, 16 )
myText1:setFillColor( 1, 0, 0 )
myText1.alpha=0
local myText2 = display.newText( “Restored”, 150, 100, native.systemFont, 16 )
myText2:setFillColor( 1, 0, 0 )
myText2.alpha=0
– local alert = native.showAlert( “Corona”, “Dream. Build. Ship.”, { “OK”, “Learn More” } )
function storeTransaction( event )
local transaction = event.transaction
if ( transaction.state == “purchased” ) then
myText1.alpha=1
--on Google Play, check and update all purchased items here
elseif ( transaction.state == “restored” ) then
myText2.alpha=1
--handle “restored” transactions here (iOS only)
– print( “productIdentifier”, transaction.productIdentifier )
– print( “originalReceipt”, transaction.originalReceipt )
– print( “originalTransactionIdentifier”, transaction.originalIdentifier )
– print( “originalDate”, transaction.originalDate )
end
store.finishTransaction( event.transaction )
end
function ss(event)
if(event.phase==“ended”)then
store.purchase( { “duck1” } )
end
return true
end
myText:addEventListener( “touch”, ss )
When click click text inapp purchase response working but when purchase the item message say item purchased successfully but transaction.state == “purchased” is not working. I tested ipad and using sandbox tester account.
This is the problem ios rejected my game in itunes connect.