tiagomtotti / firebaseNet

Client library for Firebase Cloud Messaging (FCM) written in C# / .NET
Apache License 2.0
95 stars 30 forks source link

Sending notifications to a device group #9

Open lsarni opened 7 years ago

lsarni commented 7 years ago

From what I have seen there isn't a way to creating a device group as explained here. I believe it would be useful since you might use the result in the to when creating the message.

Or is there a way and I'm not seeing it?

lsarni commented 7 years ago

Never mind, I realized that it is implemented. I just need to use RegistrationIds instead of To like this:

var message = new FirebaseNet.Messaging.Message()
{
    RegistrationIds = notificationsIds,
    Notification = new AndroidNotification()
    {
        Body = "great match!",
        Title = "Portugal vs. Denmark",
        Icon = "myicon"
    }
};

Would you consider including this somewhere in the README? If you believe is something easy to come across just feel free to close the issue. Thanks!

tiagomtotti commented 7 years ago

Sure! I'll add to the Readme

2017-05-28 16:16 GMT-03:00 lsarni notifications@github.com:

Never mind, I realized that it is implemented. I just need to use RegistrationIds instead of To like this:

var message = new FirebaseNet.Messaging.Message() { RegistrationIds = notificationsIds, Notification = new AndroidNotification() { Body = "great match!", Title = "Portugal vs. Denmark", Icon = "myicon" } };

Would you consider including this somewhere in the README? If you believe is something easy to come across just feel free to close the issue. Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tiagomtotti/firebaseNet/issues/9#issuecomment-304534350, or mute the thread https://github.com/notifications/unsubscribe-auth/AMJFQURYSz1F61BK6WN0zYldd-n0N0TBks5r-cgcgaJpZM4NoZOF .

lsarni commented 7 years ago

Actually, I realized that using RegistrationIds isn't the same to creating a device group. Right now there isn't a way to create one or to add/remove registration ids from it. I believe it would be really helpful to have one. There is some code for it from the client side in the docs but none from the server side.