niico
niico

Reputation: 12739

AppCenter.ms push notifications for Xamarin.Forms not coming through on Android

I've followed 2 tutorials on this - Android Push Notifications in Xamarin.Forms, setup AppCenter.ms and Firebase, following all instructions:

https://www.youtube.com/watch?v=t-mvM6visKU

https://www.youtube.com/watch?v=TT11e_YCRwI

Everything works (except notifications), AppCenter.ms even says 2/2 messages sent. When I run the app first on a physical device from Visual Studio it says 1/1 sent. Then I try on an Emulator (Pixel 2, Oreo 8.0) it says 2/2 sent, so they are being registered.

But notifications never come through on either device. I followed these tutorials exactly including adding the

<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false" />
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="${applicationId}" />
</intent-filter>
</receiver>

How can I debug this - any ideas?

Upvotes: 1

Views: 263

Answers (2)

niico
niico

Reputation: 12739

When setting up Firebase I chose not to enable Google Analytics. This seems to just break notifications.

When I enabled Analytics notifications started working. But actually not reliably.

Upvotes: 0

annaoomph
annaoomph

Reputation: 572

I suggest you follow the official documentation. We have pretty good guides. As for the lines you added in the manifest, they should be deleted. If that still doesn't help, send me the verbose logs, I will take a look.

Upvotes: 1

Related Questions