Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

UnityPlayer.UnitySendMessage param string is limited to 1024 bytes

Discussion in 'Android' started by Wozup, Nov 7, 2011.

  1. Wozup

    Wozup

    Joined:
    Nov 7, 2011
    Posts:
    2
    Hi All,

    I am trying to port my current Android game to work with Unity and I am using the UnityPlayer.UnitySendMessage(object, method, param) method to notify about something within my game to the Unity javascript layer. It seems that the string param that I pass can not exceed the 1024 bytes!?
    I could not find anything about this on the web or in Unity manual so i don't know if I am doing something wrong or is there some kind of limitation that nobody is talking about...:(

    Please help!

    If this is some kind of engine limitation, what is a best practice alternative to send more than 1024 bytes of data from java (Android) to Unity?

    Thanks
     
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Send two messages.
     
  3. Wozup

    Wozup

    Joined:
    Nov 7, 2011
    Posts:
    2
    Is there any other solution besides sending and accumulating messages on the Unity side?
     
  4. Freezy

    Freezy

    Joined:
    Jul 15, 2012
    Posts:
    234
    write it to a temporary file in your application cache
     
  5. Soumya-Basheer

    Soumya-Basheer

    Joined:
    Jul 22, 2015
    Posts:
    8