public void OnTappingLocalNotification(CrossPlatformNotification _notification) { // First of all we need to remove that notification if (LocalNotifications.Contains(_notification)) { LocalNotifications.Remove(_notification); } // In edit mode, save notification payload in editor preference if (IsEditMode()) { // Serialise notification object and save it in editor preference string _notificationJSONStr = _notification.JSONObject().ToJSON(); EditorPrefs.SetString(kDidStartWithLocalNotification, _notificationJSONStr); // Start playing EditorApplication.isPlaying = true; } // In play mode,received notifications are sent to event listener else { SendLocalNotification(_notification, false); } }
public void OnTappingRemoteNotification(CrossPlatformNotification _notification) { if (RemoteNotifications.Contains(_notification)) { RemoteNotifications.Remove(_notification); } if (IsEditMode()) { // Serialise notification object and save it in editor preference string _notificationJSONStr = _notification.JSONObject().ToJSON(); EditorPrefs.SetString(kDidStartWithRemoteNotification, _notificationJSONStr); // Start playing EditorApplication.isPlaying = true; } else { SendRemoteNotification(_notification, false); } }