2
First download the sample here:
https://developer.xamarin.com/samples/monodroid/Firebase/FCMNotifications/
Then you have to create a project in Firebase
http://firebase.google.com
download google-services.json
right click on the google-service.json and set the Build Action vlaue to GoogleServicesJson
when your app is running the device get the token.
To send notification to device you need serverkey which you get from firebase server and token which you get from device in running mode
To send by postmann

you can write small c# code to post to sever by webclient:
Using Microsoft Azure
First download the sample here:
https://developer.xamarin.com/samples/monodroid/Firebase/FCMNotifications/
Then you have to create a project in Firebase
http://firebase.google.com
download google-services.json
right click on the google-service.json and set the Build Action vlaue to GoogleServicesJson
when your app is running the device get the token.
To send notification to device you need serverkey which you get from firebase server and token which you get from device in running mode
To send by postmann

you can write small c# code to post to sever by webclient:
using (var client = new WebClient()) { var values = "{\"to\" : \"toekn",\"notification\" : {\"body\" : \"test\",\"title\" : \"title\",\"icon\" : \"myicon\"}}"; client.Headers.Set("Content-Type", "application/json"); client.Headers.Set("Authorization", "key=serverkey"); var response = client.UploadString("https://fcm.googleapis.com/fcm/send", values); }
Using Microsoft Azure
using System; using Microsoft.Azure.NotificationHubs; namespace SendToNotificationHub { class Program { public static string connectionString = "Endpoint=sb://app.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=yourkey"; public static string NotificationHubPath = "your-hub"; static void Main(string[] args) { SendNotificationAsync(); Console.ReadLine(); } private static async void SendNotificationAsync() { NotificationHubClient hub = NotificationHubClient.CreateClientFromConnectionString (connectionString, NotificationHubPath); var alert = "{\"aps\":{\"alert\":\"Hi!\"}}"; await hub.SendAppleNativeNotificationAsync(alert); } } }
Java training in chennai|Digital Marketing training in chennai|Tally training in chennai|Python training in chennai|SAP MM training in chennai|SAP SD training in chennai|Salesforce Developer training in chennai|SAP HANA training in chennai|ETL Testing training in chennai
I appreciate your efforts in writing such a wonderful post...Thanks for sharing...Please check my links for
Call girl services in Jaipur
Call girl services in Jaipur
Call girl services in Jaipur
Call girl services in Delhi
Call girl services in Guwahati
Call girl services in Guwahati
Call girl services in Guwahati
Call girl services in Guwahati
Call girl services in Aerocity
Lucknow call girl services
Post a Comment