Search code examples
androidandroid-activityunity-game-enginein-app-billing

in-app billing v3 unity onActivityResult


Please tell me how to call onActivityResult from Unity.
I want to get the purchase results in Unity.


Solution

  • You do not need to call onActivityResult form unity. if your purchase is successful you need to send unity message like this one

    UnityPlayer.UnitySendMessage("UnityGameObjectName", "MethodToHandlePurchaseOnSuccess", stringToSend);
    

    simillarly you can send messages to unity if your purchase is failed

    UnityPlayer.UnitySendMessage("UnityGameObjectName", "MethodToHandlePurchaseOnFail", stringToSend);