public void Invoke(string func) { var result = string.Empty; if (func == "ShowDate") { result = DateTimeObject.GetDate(); } if (func == "ShowTime") { result = DateTimeObject.GetTime(); } Callback(result); }
public void DidReceiveScriptMessage(WKUserContentController userContentController, WKScriptMessage message) { var func = message.Body.ToString(); var result = string.Empty; if (func == "ShowDate") { result = DateTimeObject.GetDate(); } if (func == "ShowTime") { result = DateTimeObject.GetTime(); } Callback(result); }