public static void HandShake() { var r = new HandShake(); string message = JObject.FromObject(r).ToString(); RNBridge.SendMessage(message); }
public static void SendCommandToReceiver(string message) { if (RNBridge.commandsReceiver == null) { return; } RNBridge.commandsReceiver.HandleCommand(RNBridge.CreateCommand(message)); }
private void SendResult(object resultData = null) { if (!completed) { completed = true; RNCommandResult data = new RNCommandResult(id, resolved, resultData); RNMessageResult result = new RNMessageResult(name, data); RNBridge.SendResult(result); } }
public static void SendEvent(String name, object data = null) { EventResult r = new EventResult(); r.name = name; r.data = data; string message = JObject.FromObject(r).ToString(); RNBridge.SendMessage(message); }
private void SendResult(object resultData = null) { if (!this.completed) { this.completed = true; if (resultData == null) { resultData = new { }; } RNBridge.SendResult(id, name, resolved, resultData); } }
public static void SendResult(int id, String name, bool resolved, object data) { CommandResult r = new CommandResult(); r.id = id; r.name = name; r.resolved = resolved; r.data = data; string message = JObject.FromObject(r).ToString(); RNBridge.SendMessage(message); }
private static void ReceiveHandshake() { System.Threading.Tasks.Task.Factory.StartNew(() => { if (commandsReceivers != null) { if (Debug.isDebugBuild) { Debug.Log($"{nameof(RNBridge)}: receive handshake"); } RNBridge.SendHandshake(new RNMessageHandshake()); } }, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, unityScheduler); }
public void HandleCommand(string message) { RNBridge.SendCommandToReceiver(message); }
public void HandShake() { RNBridge.HandShake(); }