private PendingIntent GetPendingIntent(Notification notification) { Intent intent = null; switch (notification.Type) { case NotificationType.InternalChatUpdate: case NotificationType.ExternalChatUpdate: intent = new Intent(Application.Context, typeof(SplashScreen)); intent.AddFlags(ActivityFlags.SingleTop); intent.PutExtra(Constants.AppConfig.FCMExtraName, JsonConvert.SerializeObject(notification)); return(PendingIntent.GetActivity(Application.Context, 0, intent, PendingIntentFlags.UpdateCurrent)); default: intent = new Intent(Intent.ActionView); intent.SetData(Android.Net.Uri.Parse(notification.GetWebUrl(GetBaseWebUrl(Application.Context)))); return(PendingIntent.GetActivity(Application.Context, 0, intent, PendingIntentFlags.UpdateCurrent)); } }
public void Publish(Notification notification) { _messenger?.Publish(new NotificationMessage(this, notification)); }