Skip to content

Commit

Permalink
Raise OnNotificationOpened and OnNotificationReceived events only for…
Browse files Browse the repository at this point in the history
… notifications.
  • Loading branch information
sanyandreichuk committed Apr 16, 2021
1 parent 236ab48 commit 6470ad3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sdk/Notifo.SDK.FirebasePlugin/PluginEventsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ private void FirebasePushNotification_OnNotificationOpened(object source, Fireba
protected virtual void OnNotificationOpenedEvent(NotificationEventArgs args) =>
OnNotificationOpened?.Invoke(this, args);

private bool IsNotificationData(IDictionary<string, object> data) =>
data?.ContainsKey(Constants.IdKey) ?? false;
private bool IsNotificationData(IDictionary<string, object> data)
{
if (data == null)
{
return false;
}

return data.ContainsKey(Constants.SubjectKey) || data.ContainsKey(Constants.ApsAlertTitleKey);
}
}
}

0 comments on commit 6470ad3

Please sign in to comment.