bytefish / FcmSharp

Firebase Cloud Messaging (FCM) with .NET
MIT License
6 stars 7 forks source link

Question #55

Closed angelru closed 5 years ago

angelru commented 5 years ago

Hello,

Great library.

I want to create a backend in .net core for manage push notifications.

I want use your library,

  1. Is it safe to save the .json (serviceAccountKey) in the root of the project?

  2. how would you create an example like this

{
    "to":"/topics/General",
    "data": {
        "message" : "my_custom_value",
        "other_key" : true,
        "body":"test"
     },
     "priority": "high"
}
  1. I think it would be good in the documentation more examples of use.

Thanks a lot!!!

bytefish commented 5 years ago
  1. The ServiceAccountKey is your Private Key used to sign requests to Firebase. As such it used to authorize your requests to Firebase and you should never leak it into public.

  2. What do you want to achieve? An example for sending data messages is here: https://github.com/bytefish/FcmSharp/tree/master/FcmSharp/Examples. An example for sending a Notification is given here: https://github.com/bytefish/FcmSharp/blob/master/FcmSharp/FcmSharp.Console/Program.cs.

  3. Yes, there is indeed an ongoing issue at https://github.com/bytefish/FcmSharp/issues/34, which is used for discussion and should lead to more examples. The library itself is a 1:1 translation of the Firebase Cloud Messaging protocol, which has a good documentation at: https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages. So you probably also want to look there for additional explanations and examples.