android - UnitySendMessage not working from non-unity activity -
i'm developing android plugin should start activity (with ui , everything...). activity (which not inherits unityplayeractivity of course) should send message unity c# code. i'm trying call unityplayer.unitysendmessage, see log moment before sending message c# side doesn't it (no exception raised).
this callback called other activity:
@override public void generatepayload() { try { log.v(tag, "generatepayload triggered"); unityplayer.unitysendmessage("androidobject", "generatepayloadmessage", ""); } catch (exception ex) { log.e(tag, "failed send message unity"); } } - i've tried call method unity primary activity , message received in unity side.
- i've tried send message other activity (as should) in main thread , didn't work too...
any suggestions? can't send message unity while unityactivity isn't in foreground? if situation - can do?
there no message/string sent in code above target object , method, sending empty string generatepayloadmessage([nothing being sent])
try
unityplayer.unitysendmessage("androidobject", "generatepayloadmessage", "hello world");
also please state have set on unity side handle message.
Comments
Post a Comment