구매가 완료되면 스토어리스너의 ProcessPurchase
메서드가 호출됩니다. 애플리케이션은 구매 내역을 실행해야 합니다. 예를 들어, 로컬 콘텐츠를 잠금 해제하거나 서버에 구매 영수증을 보내 서버측 게임 모델을 업데이트해야 합니다.
애플리케이션이 구매 처리를 완료했는지 표시하기 위해 결과가 아래와 같이 반환됩니다.
결과 | 설명 |
---|---|
PurchaseProcessingResult.Complete | 애플리케이션이 구매 처리를 완료하였으며 이에 대해 다시 알리지 않습니다. |
PurchaseProcessingResult.Pending | 애플리케이션이 아직 구매를 처리하고 있는 상태이며 애플리케이션이 다음에 실행되면 IStoreController 의 ConfirmPendingPurchase 함수가 호출되지 않는 한 ProcessPurchase가 호출됩니다. |
ProcessPurchase는 초기화 성공 이후 아무때나 호출될 수 있습니다. ProcessPurchase
핸들러 실행 도중 애플리케이션이 크래시하는 경우, Unity IAP가 다음에 초기화되면 다시 호출되므로 추가적으로 데이터 중복 제거를 구현하는 것이 좋습니다.
Unity IAP는 네트워크 장애나 애플리케이션 크래시가 발생하는 경우에도 구매가 신뢰성있게 완료되도록 명시적 구매 인지를 요구합니다. 애플리케이션이 오프라인 상태인 경우에 완료된 구매는 다음 초기화 시점에서 애플리케이션에 전송됩니다.
PurchaseProcessingResult.Complete
가 반환되면 Unity IAP는 거래를 아래의 다이어그램에서 보는 바와 같이 즉시 완료합니다.
소모품을 판매하며 서버에서 처리하는 경우, 예를 들어 온라인 게임에서 화폐를 제공하는 경우, PurchaseProcessingResult.Complete
를 반환해서는 안됩니다.
이 클래스를 반환하면, 클라우드 저장이 되지 않은 상태에서 애플리케이션이 삭제될 때 소모품 구매 내역이 손실될 수 있기 때문입니다.
소비 품목 구매를 클라우드에 저장하는 경우, 구매를 성공적으로 완료한 경우에만 PurchaseProcessingResult.Pending
를 반환하고 ConfirmPendingPurchase
를 호출해야 합니다.
Pending
를 반환하는 경우 Unity IAP는 처리를 확인하기 전까지 해당 스토어 내의 거래를 유지시켜서 소비 품목이 이러한 상태일 때 사용자가 애플리케이션을 다시 설치하더라도 그 구매 내역이 손실되지 않도록 합니다.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.