这是indexloc提供的服务,不要输入任何密码
Skip to content

Sending notifications using C# FirebaseAdmin 2.4.0 doesn't work. Invalid value at 'message.android.notification.event_time' #370

@EsposBjorne

Description

@EsposBjorne

Sending notifications using C# with Nuget package "FirebaseAdmin" version 2.4.0 doesn't work.
ERROR: Invalid value at 'message.android.notification.event_time'.

Our currently working FirebaseAdmin version is 1.1.4 and that is using the legacy cloud messaging API. Because of the migration to the new API which need to happend before june 2024, we updated to the latest FirebaseAdmin 2.4.0 that uses the new api with versioning "/V1". We earlier used "SendAllAsync", but are now trying to use "SendEachAsync" do to deprecation.

firebase

Our current AndroidConfig looks like this:

Android = new AndroidConfig
{
    Notification = new AndroidNotification
    {
        ClickAction = "FLUTTER_NOTIFICATION_CLICK",
        ChannelId = "fcm_default_channel",
        Icon = "ic_notif",
        EventTimestamp = DateTime.UtcNow //Added afterwards cause of error but didn't resolve our issue.
    },
    CollapseKey = "type_a"
},

Somehow the EventTimestamp is not working properly. Any suggestions?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions