Xamarin.Android Not receive notification

Hello,
I am developing a Xamarin.Android application to receive notifications from Parse. But my device is not receiving notifications. Here is my code:

My AndroidManifest.xml :

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.test">
    <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
	<uses-permission android:name = "com.google.android.c2dm.permission.RECEIVE" />
	<uses-permission android:name = "android.permission.ACCESS_WIFI_STATE" />
	<uses-permission android:name = "android.permission.INTERNET" />
	<uses-permission android:name = "android.permission.ACCESS_NETWORK_STATE" />
	<uses-permission android:name = "android.permission.WAKE_LOCK" />
	<uses-permission android:name = "android.permission.VIBRATE" />
	<permission android:protectionLevel = "signature" android:name = "com.companyname.test.permission.C2D_MESSAGE" />
	<uses-permission android:name = "com.goodchapp.android.permission.C2D_MESSAGE" />
	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
	<uses-permission android:name="android.permission.INTERNET" />
	
    <application android:label="test.Android" android:theme="@style/MainTheme">

		<meta-data android:name="com.parse.push.gcm_sender_id"
             android:value="id:xxxxxxxx" />

		<service
    android:name="com.parse.fcm.ParseFirebaseInstanceIdService"
    android:exported="true">
			<intent-filter>
				<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
			</intent-filter>
		</service>

		<service
    android:name="com.parse.fcm.ParseFirebaseMessagingService">
			<intent-filter>
				<action android:name="com.google.firebase.MESSAGING_EVENT"/>
			</intent-filter>
		</service>

		<receiver
    android:name="com.parse.ParsePushBroadcastReceiver"
    android:exported="false">
			<intent-filter>
				<action android:name="com.parse.push.intent.RECEIVE" />
				<action android:name="com.parse.push.intent.DELETE" />
				<action android:name="com.parse.push.intent.OPEN" />
			</intent-filter>
		</receiver>
	</application>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>

And my ParseApplication :

namespace test.Droid
{
        [Application(Name = "com.companyname.test.ParseApplication")]
        class ParseApplication : Application
        {
            public ParseApplication(IntPtr handle, JniHandleOwnership ownerShip)
                : base(handle, ownerShip)
            {
            }

            public override void OnCreate()
            {
                base.OnCreate();
                ParseClient.Initialize(new ParseClient.Configuration
                    {
                        ApplicationId = "app_id",
                        WindowsKey = "master-key",
                        Server = "http://192.168.X.XXX:8080/parse/"
                    });
                ParseUser.LogInAsync("test", "test");
                ParsePush.ParsePushNotificationReceived += ParsePush.DefaultParsePushNotificationReceivedHandler;
                ParseInstallation.CurrentInstallation.SaveAsync();
            
            }
    }

When I launch the application I get a field in the installation table of my parse Server.
In this entry the GCMSenderId and DeviceToken fields are empty. When I send a notification from the dashboard, I see that no one receives the notification.

Hello, the Firebase Instance ID service is deprecated, and it might not work properly.

Just remove it, and the Device Token might start being rightly filled.

For the Sender ID, on Android, you must set it during the installation process.

It should be like this:

ParseInstallation installation = ParseInstallation.getCurrentInstallation();
installation.put("GCMSenderId", INSERT_YOUR_SENDER_ID);
installation.saveInBackground();

With the snippet above, the GCMSenderId field shall start being filled.

These steps work for all of my Android Studio projects, so, please, let me know if they also work for Xamarin projects.

Thanks for your answer, when I deploy my application I get the error:
Unable to instantiate service com.parse.fcm.ParseFirebaseMessagingService: java.lang.ClassNotFoundException: Didn't find class "com.parse.fcm.ParseFirebaseMessagingService"

All right, have you removed this service too?
If so, put it again, and just remove the InstanceId.

Your manifest must be like this:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.test">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
	<uses-permission android:name = "com.google.android.c2dm.permission.RECEIVE" />
	<uses-permission android:name = "android.permission.ACCESS_WIFI_STATE" />
	<uses-permission android:name = "android.permission.INTERNET" />
	<uses-permission android:name = "android.permission.ACCESS_NETWORK_STATE" />
	<uses-permission android:name = "android.permission.WAKE_LOCK" />
	<uses-permission android:name = "android.permission.VIBRATE" />
	<permission android:protectionLevel = "signature" android:name = "com.companyname.test.permission.C2D_MESSAGE" />
	<uses-permission android:name = "com.goodchapp.android.permission.C2D_MESSAGE" />
	<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
	<uses-permission android:name="android.permission.INTERNET" />
	
<application android:label="test.Android" android:theme="@style/MainTheme">

		<meta-data android:name="com.parse.push.gcm_sender_id"
         android:value="id:xxxxxxxx" />

		<service
android:name="com.parse.fcm.ParseFirebaseMessagingService">
			<intent-filter>
				<action android:name="com.google.firebase.MESSAGING_EVENT"/>
			</intent-filter>
		</service>

		<receiver
android:name="com.parse.ParsePushBroadcastReceiver"
android:exported="false">
			<intent-filter>
				<action android:name="com.parse.push.intent.RECEIVE" />
				<action android:name="com.parse.push.intent.DELETE" />
				<action android:name="com.parse.push.intent.OPEN" />
			</intent-filter>
		</receiver>
	</application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>

I still have the error: Unable to instantiate service com.parse.fcm.ParseFirebaseMessagingService …

Would you mind sharing your gradle with your dependencies?

I haven’t gradle in Xamarin