TobiasBuchholz / Plugin.Firebase

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

Couldn't attach image to push notification if the app is in foreground #133

Closed RsZoli closed 1 year ago

RsZoli commented 1 year ago

If the app is in foreground, there is an exception possibly in the onrecieved function:

[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

If the app is in the background, notifications are working just fine:

[FirebaseMessaging] Missing Default Notification Channel metadata in AndroidManifest. Default value will be used.

I'm building against net7.0-android

.NET SDK: Version: 7.0.103 Commit: 276c71d299

.NET SDKs installed: 7.0.103 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 7.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 7.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 7.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

TobiasBuchholz commented 1 year ago

Hi, did you complete all android specific steps from the docs? You can also take a look at the sample project.

RsZoli commented 1 year ago

@TobiasBuchholz Hi! As i have mentioned this on the other issue, i did these steps!

Now, it is working, but the error message is still present in the console!

TobiasBuchholz commented 1 year ago

See https://github.com/TobiasBuchholz/Plugin.Firebase/issues/156#issuecomment-1498107791