Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to use AndroidJavaObject.Call() function? #925

Open
Raonshi opened this issue Feb 8, 2024 · 0 comments
Open

Is there any way to use AndroidJavaObject.Call() function? #925

Raonshi opened this issue Feb 8, 2024 · 0 comments
Labels
question Further information is requested

Comments

@Raonshi
Copy link

Raonshi commented Feb 8, 2024

@juicycleff

Hi. When I making a flutter application with unity, I hot a problem.

My Unity project made by other team (I can not control the unity source code). Also, I have to implement some IPC protocol to communicate unity and flutter. this protocol have to return some value which unity need.

I can't share my code because of security policy. instead, I can share some similar code. like this.

/* Unity Code */
AndroidJavaClass jc = AndroidJavaClass("com.my.flutter.android.module");
stirng result = jc.Call("requestSomeEncodedJson"); // Important line. I have to return the result.
/* Flutter Code */

// This function called by unity
String requestSomeEncodedJson(String param1, int param2) {
  String result = "";
  /* Implements business logic */
  return jsonEncode(result);
}
@timbotimbo timbotimbo added the question Further information is requested label Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants