Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android notification OnReceived conditions #145

Open
craigvl opened this issue Jun 2, 2020 · 0 comments
Open

Android notification OnReceived conditions #145

craigvl opened this issue Jun 2, 2020 · 0 comments

Comments

@craigvl
Copy link

craigvl commented Jun 2, 2020

Guys,

Just a quick question regrading this if statement below that is found in the file [DefaultPushNotificationHandler.android.cs] (

if ((parameters.TryGetValue(SilentKey, out var silent) && (silent.ToString() == "true" || silent.ToString() == "1")) || (IsInForeground() && (!(!parameters.ContainsKey(ChannelIdKey) && parameters.TryGetValue(PriorityKey, out var imp) && ($"{imp}" == "high" || $"{imp}" == "max")) || (!parameters.ContainsKey(PriorityKey) && !parameters.ContainsKey(ChannelIdKey) && PushNotificationManager.DefaultNotificationChannelImportance != NotificationImportance.High && PushNotificationManager.DefaultNotificationChannelImportance != NotificationImportance.Max))))
)

Are there any reasons behind the conditions here? It seems that when an Android notification is received and the app is in the foreground the above code prevents the notification from going into the tray, just wondering if there is a reason for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant