Skip to content

MAUI push notifications not received in OnMessageReceived unless trimming disabled on android #16014

@LewisEKay

Description

@LewisEKay

Description

Using the package Plugin.Firebass to set up push notifications for MAUI. Many tutorials online exist for setting up push notifications now, however none showing how to receive messages.

if you send a message to the device onMessageReceiced will receive it as expected. However if you go to publish, it will not work. This is because by default MAUI disabled trimming for debug and enables it for release. So if you disable trimming along with AoT (doesn’t work without trimming enabled) then push notifications work fine and all is good. However, trimming and AoT are now disabled which is not ideal.

Steps to Reproduce

  1. Create new project.
  2. Follow install instructions for setting up Plugin.Firebase
  3. Create a new ServiceIntent for receiving push notifications like we used to do in Xamarin.Forms.
  4. Send notification to device, it won’t call onMessageReceived and instead only show a notification in the devices notification window.

Link to public reproduction project repository

None

Version with bug

7.0.49

Last version that worked well

6.0

Affected platforms

Android

Affected platform versions

Android 11 and up

Did you find any workaround?

Disable Trimming and AoT

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-essentialsEssentials: Device, Display, Connectivity, Secure Storage, Sensors, App Infopartner/androidIssues for the Android SDKplatform/androids/triagedIssue has been reviewedt/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions