Actually I tried to send notification for single device through Test On Device option in Console. It shows completed but notification not received by device. And then I tried postman and pushtry.com, both of them gave result "Firebase Push Notification Sent Successfully", even though the android device(Google Pixel Version 9) not received. Please help me to resolve this problem.
Asked
Active
Viewed 316 times
-2
-
Include code how have you set up fcm – user1209216 Mar 01 '19 at 18:12
2 Answers
0
You are probably not having a Notification channel in your MainActivity you can configure it something like below:
void CreateNotificationChannel()
{
if (Build.VERSION.SdkInt < BuildVersionCodes.O)
{
// Notification channels are new in API 26 (and not a part of the
// support library). There is no need to create a notification
// channel on older versions of Android.
return;
}
var channel = new NotificationChannel(CHANNEL_ID, "FCM Notifications", NotificationImportance.Default)
{
Description = "Firebase Cloud Messages appear in this channel"
};
var notificationManager = (NotificationManager) GetSystemService(NotificationService);
notificationManager.CreateNotificationChannel(channel);
}
And then call it from MainActivity's OnCreate Method

FreakyAli
- 13,349
- 3
- 23
- 63
-
No. i have already added this part in MainActivity.cs, and IsPlayServicesAvailable() method. – Mohanasundharam Feb 28 '19 at 11:51
-
Yes, Mr.Hakim, In Xamarin Android, while developing firebase push notification i followed all the methods and concepts as per the Firebase Documentation. Token generated successfully, when i try to sent notification from the firebase console, it shows completed and i tried postman also it give success status:1 but after sometimes i tried to send notification, it gave the result like token id was invalid and not registered. Another important thing is at any situation, notification is not received in My device. How can i solve this? – Mohanasundharam Feb 28 '19 at 13:22
-
Code successfully build and run, token generation successfully done, firebase console also sent notification successfully, but the issue raised where receive the notification in mobile. I hope you get my point! – Mohanasundharam Feb 28 '19 at 13:26
-
I am not asking you to explain the issue it is easier for me to find the issue if you just add the relevant code that you have used to configure your Firebase push notifications – FreakyAli Feb 28 '19 at 15:05
-
To determine if you are actually receiving anything, debug your firebase service – user1209216 Mar 01 '19 at 18:13
0
Minimize your application(for example go to dashboard or lock the phone) and send the FCM push notification. If you able receive the notification in this case, that mean you FCM is configured properly. The code you share will only work if you app in in background. IF you wish to receive the notification when app is in background. You have to implement inherit FireBaseMessagingService call and override OnMessageRecived method.

Piyush Priyadarshi
- 21
- 2