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

Cannot Gracefully Override DefaultPushNotificationHandler #467

Open
LeeWhite187 opened this issue Jul 26, 2023 · 0 comments
Open

Cannot Gracefully Override DefaultPushNotificationHandler #467

LeeWhite187 opened this issue Jul 26, 2023 · 0 comments

Comments

@LeeWhite187
Copy link

LeeWhite187 commented Jul 26, 2023

🐛 Bug Report

Summary:
FirebasePushNotificationManager.android.cs limits visibility of DefaultNotificationActivityType to its own assembly, preventing any overrides of DefaultPushNotificationHandler from accessing the same information as their base.

Description:
This library provides the ability to override the default notification handler by deriving from class, DefaultPushNotificationHandler.
But, the virtual method, OnReceived, checks a property of 'FirebasePushNotificationManager', called 'DefaultNotificationActivityType', which is scoped as 'internal static'.
Since 'internal static' limits visibility to code inside the Firebase assembly, any overriding types of DefaultPushNotificationHandler cannot observe the same property information as the base type.
This prevents an overriding type from being function compatible with the base type, without workarounds.

Expected behavior

The expected behavior is that the OnReceived method of DefaultPushNotificationHandler can gracefully be overridden.
Meaning, all calls and properties it uses are accessible to an override of it.

Reproduction steps

  1. Create a derived class of DefaultPushNotificationHandler.
  2. In the derived class, create an override method for OnReceived.
  3. Include in the method override, all code from the method of the base.
  4. Observe the compiler error that:
    "FirebasePushNotificationManager does not contain a definition of DefaultNotificationActivityType".

Configuration

No special configuration is required to observe this issue.

Version: 1.x
This issue is present in library v3.4.35.

Platform:
This issue appears to only affect Android.

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