CrossGeeks/FirebasePushNotificationPlugin

Cannot Gracefully Override DefaultPushNotificationHandler

LeeWhite187 opened this issue ยท 0 comments

๐Ÿ› 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.