How to call UnitySendMessage to an interface method

Working on Android Plugin for Unity.

To communicate from Android to Unity I use UnityPlayer.UnitySendMessage(string s1,string s2, string s3), this method takes as parameters three strings:

  1. s1: GameObject name that will receive the message.
  2. s2: Name of the Method that will handle the message.
  3. s3: The message.

So this setup works, on my android plugin I use the follow code to send the message to my UnityClass:

 UnityPlayer.UnitySendMessage("GameObjectName", "OnResult", results);

In Unity, my GameObject with the name “GameObjectName” implements the method:

private void OnResult(string recognizedResult);

Now it comes the trouble

Now I want that this GameObject class implements an interface to make it mandatory the handling of the “OnResult”.

BUT if I create the following interface:

//Interface for MonoBehaviour plugin holder
public interface IPlugin
{
    void OnResult(string recognizedResult);
}

And then on my MonoBehaviour class I implement the interface so it looks like:

void IPlugin.OnResult(string recognizedResult)

This approach seems to do not work. I’ve tried to call UnitySendMessage with both "OnResult" and "IPlugin.OnResult", neither works.

I’m doing something wrong? Or it’s just a limitation? Thanks!

@YorickVanVliet has response my question in StackOverflow, if somebody else is looking for the same problem, this is the answer: