TobiasBuchholz / Plugin.Firebase

Wrapper around the native Android and iOS Firebase Xamarin SDKs
MIT License
211 stars 49 forks source link

[DOTNET] [Plugin.Firebase]: Couldn't attach image to push notification #156

Closed imoulas closed 1 year ago

imoulas commented 1 year ago

I'm sending a test message (without image, plain text) from firebase cloud messaging and i'm getting the following error on Android.

[DOTNET] [Plugin.Firebase]: Couldn't attach image to push notification: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference

I'm using .NET7 on Mac Visual Studio 17.5.2.

any idea?

TobiasBuchholz commented 1 year ago

This error message gets printed because the default notification builder tries to set a big picture to the notification but fails because there is no image url.

This shouldn't be any problem regarding showing the push notification, so you can ignore it. If you are having trouble receiving push notifications, take a look at https://github.com/TobiasBuchholz/Plugin.Firebase/issues/145#issuecomment-1455182588.

Nevertheless I've made a fix for the next plugin version so this error message will only appear if there actually is an image url and there is something wrong with it.