Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
how to restore iAP purchase for ios ? — Gideros Forum

how to restore iAP purchase for ios ?

edited July 2014 in General questions
i have successfully integrated iAP purchase but when i am trying to implement iAP restore my game crash :(
i dont know what's happening wrong !!!

Comments

  • here is my code
    function onTransaction(event) 
     
    		if event.transaction.state == StoreKit.FAILED then
    			AlertDialog.new("error ",event.errorDescription , "Ok"):show()	
    		else        
    			if event.transaction.state == StoreKit.RESTORED then	
    					AlertDialog.new("title", "You had restored  UnlockStages", "Ok"):show()	
    			end
    			sceneManager:changeScene("optionScreen", 1, SceneManager.fade, easing.linear)
    		end
     
    		storekit:finishTransaction(event.transaction)
    		storekit:removeEventListener(Event.RESTORE_TRANSACTIONS_COMPLETE, onTransaction)
    	end
    	if application:getDeviceInfo() == "iOS" then
    		storekit:addEventListener(Event.RESTORE_TRANSACTIONS_COMPLETE, onTransaction)
    	end
     
    storekit:restoreCompletedTransactions()
  • ar2rsawseenar2rsawseen Maintainer
    @bharat_prajapati try not removing onTransaction event after first transaction

    And is there any error message? At least is it a Lua crash or native crash?
  • thanks for your reply

    it's native crash

    when i call storekit:restoreCompletedTransactions() my game crash
    and also i have put alertDialog in onTransaction to know error but it's not working
Sign In or Register to comment.