@@ -24,17 +24,17 @@ class Program
2424
2525 #region FCM Sender Settings
2626
27- private const string fcmServiceAccountFilename = "TODO " ;
28- private const string fcmReceiverToken = "TODO " ;
29-
27+ private const string fcmServiceAccountFilename = "/Users/andrei/Projects/FCMTokens/mobileinstein-174121-e899c9a53553-new.json " ;
28+ private const string fcmReceiverToken = "dAaOttQ1SlmtlP_b5yli5K:APA91bGDVKu8vk1a9_BG7KRcMI4YVPYqT7yZ4VXXZ7eiWu4vr1FYOf2-1LBTLae3PjscNPvSWtJZ03iE6mTrWNYFEoJy3QgwDUgMR7Mo0GJdXGj4eGlUEcIugKHub5Js122_8ox6n8RP " ;
29+
3030 # endregion
3131
3232 private static readonly HttpClient http = new ( ) ;
3333
3434 static async Task Main ( )
3535 {
3636 // await SendApnNotificationAsync();
37- // await SendFcmNotificationAsync ();
37+ await SendFirebaseNotificationAsync ( ) ;
3838
3939 Console . WriteLine ( "Done!" ) ;
4040 }
@@ -61,22 +61,22 @@ private static async Task SendApnNotificationAsync()
6161 }
6262 }
6363
64- private static async Task SendFcmNotificationAsync ( )
64+ private static async Task SendFirebaseNotificationAsync ( )
6565 {
6666 var contents = await File . ReadAllTextAsync ( fcmServiceAccountFilename ) ;
6767 var serializer = new DefaultCorePushJsonSerializer ( ) ;
6868 var settings = serializer . Deserialize < FirebaseSettings > ( contents ) ;
6969
7070 var fcm = new FirebaseSender ( settings , http ) ;
71- var payload = new FirebasePayload
71+ var payload = new
7272 {
73- Message = new FirebaseMessage
73+ message = new
7474 {
75- Token = fcmReceiverToken ,
76- Notification = new FirebaseNotification
75+ token = fcmReceiverToken ,
76+ notification = new
7777 {
78- Title = "Test" ,
79- Body = "Test Body"
78+ title = "Test" ,
79+ body = "Test Body"
8080 }
8181 }
8282 } ;
0 commit comments