No event on data only firebase message
See original GitHub issueHi
I am trying to send a data message but event is not triggered. I am using FirebaseNet nuget package as shown in the docs.
When i do : ` FCMClient client = new FCMClient(serverKey);
var message = new Message()
{
Data = data,
};
message.RegistrationIds = registrationIds;
var result = await client.SendMessageAsync(message);
DownstreamMessageResponse specificResult = (DownstreamMessageResponse)result;`
No events, and a success response from firebase.
When i add the Notification section i do get the event with the data, but i also get the notification ofcourse.
` FCMClient client = new FCMClient(serverKey);
var message = new Message()
{
Data = data,
Notification = new AndroidNotification()
{
Body = body,
Title = title,
}
};
message.RegistrationIds = registrationIds;
var result = await client.SendMessageAsync(message);
DownstreamMessageResponse specificResult = (DownstreamMessageResponse)result;`
I have attached to the handler in Android
` //Handle notification when app is closed here CrossFirebasePushNotification.Current.OnNotificationReceived += (s, p) => {
};`
And the one in App.cs
` private void Current_OnNotificationReceived(object source, FirebasePushNotificationDataEventArgs e) {
}`
Neither one of them trigger with the data only. Any idea’s ?
Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
Hi @rdelrosario
Thanks again for the help!
This handler is just fired when receives the notification immediately if you are using data messages. I will recommend not to use notification message and always send it as data message.