Unity IAP 관련 질문

안녕하세요
유니티로 갤럭시 IAP를 구현하였는데 구매를 시도했다가 취소하였을때도 아이템이 들어옵니다.

onSuccessPurchaseItem는 구매가 성공하였을 때 실행되는 이벤트입니다.
따라서
SamsungIAP.Instance.StartPayment(_ItemID, “pass_through_param”, onSuccessPurchaseItem)
함수에 넣어서 구매에 성공하였을 경우 onSuccessPurchaseItem 이벤트가 실행되는 것으로 생각하였는데

제 생각이 틀린건가요?

구매가 성공하였을 경우에만 해당 이벤트가 발생하게 하려면 어떻게 해야하나요?

Hi studio_bong,
Welcome to the Samsung Developer Community.

  • Use the StartPayment() method to initiate a purchase and payment transaction for a specified in-app item.
    SamsungIAP.Instance.StartPayment("com.mygame.product1", "pass_through_value", OnPayment);

  • After processing is complete, the OnPayment callback is triggered.

  • If payment is successful then it contains information about the purchased item, the transaction, and API call processing.

  • If payment is not successful then it will contain the error code.

According to your code, onSuccessPurchaseItem callback is triggered when the payment process is completed. It can contain either detail information about your purchase or error code.

You can check out the Android IAP SDK-Programming Guide for details. Please let me know if you can’t understand anything.

Regards,
Jakia

1 Like