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

Make Android OnReceived condition virtual, fix UnsubscribeAll ios Bug and Update to new firebase sdk #444

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

AlleSchonWeg
Copy link
Contributor

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Feature

⤵️ What is the current behavior?

The condition to skip displaying a notification with android is confusing/complicated:

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) && FirebasePushNotificationManager.DefaultNotificationChannelImportance != NotificationImportance.High && FirebasePushNotificationManager.DefaultNotificationChannelImportance != NotificationImportance.Max))))

More infos: #434

🆕 What is the new behavior (if this is a feature change)?

With this change it is possible to implement a custom condition or simple skip the condition (return false). Just override the virtual method.

💥 Does this PR introduce a breaking change?

No.

🐛 Recommendations for testing

📝 Links to relevant issues/docs

🤔 Checklist before submitting

  • All projects build
  • Follows style guide lines
  • Relevant documentation was updated
  • Rebased onto current develop

@AlleSchonWeg
Copy link
Contributor Author

Fixed a bug in FirebasePushNotificationManager.ios.cs. You loop thru currentTopics array in UnsubscribeAll and in the loop you remove items in currentTopics. Which results in an incomplete Unsubscribe operation.

@AlleSchonWeg AlleSchonWeg changed the title Make Android OnReceived condition virtual Make Android OnReceived condition virtual and fix UnsubscribeAll ios Bug Dec 7, 2022
@AlleSchonWeg
Copy link
Contributor Author

Hi @rdelrosario,
could you merge this and release a new version?
Thank you very much!

@AlleSchonWeg AlleSchonWeg changed the title Make Android OnReceived condition virtual and fix UnsubscribeAll ios Bug Make Android OnReceived condition virtual, fix UnsubscribeAll ios Bug and Update to new firebase sdk Apr 19, 2024
@thomasgalliker
Copy link

thomasgalliker commented May 14, 2024

@rdelrosario can we expect this change to be merged before June 2024?
@AlleSchonWeg thanks for your effort. We'd need an upgrade of this package for our old xamarin apps - they're probably not migrated to .NET MAUI by June 2024...

@AlleSchonWeg
Copy link
Contributor Author

Hi @thomasgalliker ,
i think this package will still work. I accidently pushed the last commits to this pull request. I only want to test the new bindings project with XF. And it works.
If you want you can take my changes to your new plugin. It would we great if your plugin will also run with XF apps.

@thomasgalliker
Copy link

Ok cool. Its a nightmare to have to support .net maui and XF in one single project. I would rather publish a new nuget for xf (temporarily) until we have migrated to maui. Yet another nuget, I know what you think. The best solution would be to publish this changes here but it look like this plugin is no longer maintained….

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

Successfully merging this pull request may close these issues.

2 participants