public bool SendPushNotification(string deviceId, string message) { //applicationID = "AIzaSyxxxxxxxxxxxxxxxxxxx" // senderId = "98xxxxxxxxx" bool isSent = false; string str = ""; try { WebRequest tRequest = WebRequest.Create("https://fcm.googleapis.com/fcm/send"); tRequest.Method = "post"; tRequest.ContentType = "application/json"; var data = new { to = deviceId, notification = new { body = message, title = "SpAlert", sound = "Enabled" } }; var serializer = new JavaScriptSerializer(); var json = serializer.Serialize(data);
.Net and Xamarin Developer