public static string CallMessage(string message) { if (!_isInitialized) { Initialize(); } ToastUnityMessage unityMessage = new ToastUnityMessage(message); string uri = unityMessage.GetUri(); ToastUnityAction action = ToastActionHandler.GetAction(uri); if (action == null) { ToastLog.Error("Not supported uri: " + uri); ToastNativeMessage toastNative = ToastNativeMessage.CreateErrorMessage(uri, unityMessage.TransactionId, false, ToastNativeCommonErrorCode.NotSupportedUri.Code, uri + " action not found"); ToastLog.Debug(toastNative.ToJsonString()); return(toastNative.ToString()); } return(action.OnMessage(unityMessage)); }
public static void RegisterAction(string uri, ToastUnityAction action) { _actions.Add(uri, action); }