2013-07-02 3 views
2

내 응용 프로그램에서 나는 애플 리케이션 purchasing.it를 구입 완벽하게 구입했습니다.하지만 내 애플 리케이션을 삭제하고 다시 installed.its 옵션을 복원 상태를 반환하는 상태를 복원하거나 복구 코드를 복구하는 방법을 사용하는 방법을 반환합니다. 나는 그들이 android corona sdk 용 Inapp Restore?

store.restore() 

에게 인터넷을 통해 검색이되지 항목 목록을 구입하는 방법을 다음 안드로이드에서 작동합니다.

답변

2

Google Play 마켓 플레이스에는 상품에 대한 '복원 됨'상태가 없습니다. 구매 한 모든 항목은 '구매 한'상태로 그룹화됩니다. 복원을 수행 할 때 파일/데이터베이스에 저장된 모든 구매 (소모품 구매 제외)를 지우고 반환 된 복원 된 구매를 정상 구매로 처리해야합니다. 복원의

안드로이드에

, 첫 번째 일치하는 대신 '구입'상태에 콜백을 얻을 것이다 경우 조건 아래 :

local store = require "store" 

function transactionCallback(event) 
    local transaction = event.transaction 
    if transaction.state == "purchased" then 
     print("Transaction succuessful!") 
    elseif transaction.state == "restored" then 
     print("Transaction restored (from previous session)") 
     print("productIdentifier", transaction.productIdentifier) 
     print("receipt", transaction.receipt) 
     print("transactionIdentifier", transaction.identifier) 
     print("date", transaction.date) 
     print("originalReceipt", transaction.originalReceipt) 
     print("originalTransactionIdentifier", transaction.originalIdentifier) 
     print("originalDate", transaction.originalDate) 
    elseif transaction.state == "cancelled" then 
     print("User cancelled transaction") 
    elseif transaction.state == "failed" then 
     print("Transaction failed, type:", transaction.errorType, transaction.errorString) 
    else 
     print("unknown event") 
    end 

    -- Once we are done with a transaction, call this to tell the store 
    -- we are done with the transaction. 
    -- If you are providing downloadable content, wait to call this until 
    -- after the download completes. 
    store.finishTransaction(transaction) 
end 

store.init(transactionCallback) 
store.restore()