How to pass a JNI C# class into Java or handle this situation?

前端 未结 6 2629
[愿得一人]
[愿得一人] 2021-02-20 01:42

I\'m trying to call a Java method from C#, it\'s called like this from java:

EgamePay.pay(thisActivity, payAlias, new EgamePayListener() {
            @Override
         


        
6条回答
  •  名媛妹妹
    2021-02-20 02:15

    I ended up solving this problem myself, the other answers posted here while good unfortunately did not address the fact the problem I was facing was in Unity.

    The way I solved it was by writing a custom listener class in Java with a 'GetResult' function that returned a string explaining what the outcome was (i.e. which function was called and with what result) and a get function for the result which C# called through AndroidJNI.

    After making the purchase call it was a matter of calling the get function from C# until I had a result.

提交回复
热议问题