public DefaultPushNotificationHandler() { context = Xamarin.Essentials.Platform.CurrentActivity ?? Application.Context; appPreferences = new AppPreferences(context); appPreferences.SaveNotification(new List <NotificationModel>()); notificationManager = NotificationManagerCompat.From(context); }
public override void OnReceive(Context context, Intent intent) { IDictionary <string, object> parameters = new Dictionary <string, object>(); var extras = intent.Extras; AppPreferences appPreferences = new AppPreferences(context); appPreferences.SaveNotification(new List <NotificationModel>()); if (extras != null && !extras.IsEmpty) { foreach (var key in extras.KeySet()) { parameters.Add(key, $"{extras.Get(key)}"); System.Diagnostics.Debug.WriteLine(key, $"{extras.Get(key)}"); } } FirebasePushNotificationManager.RegisterDelete(parameters); }