firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

Add a "sentTime" property as it is done on Android SDK

Open Tom3652 opened this issue 2 years ago • 12 comments

Feature proposal

  • Firebase Component: Messaging

Hello !
I am a Flutter developer so i am sorry in advance for the naming conventions / objects that i will describe below, that are probably different from the ones in the native SDKs.

Problem :

I have spoken to a FlutterFire developer in this issue about a sentTime property of the RemoteMessage object when receiving a notification on an iOS device.

In Android, when receiving a notification, we receive a timestamp that is the time when the notification was sent. In the iOS SDK, it seems that such property does not exist.
I have contacted Firebase support but they told me that i should see directly with the iOS SDK team as well.

So far as a workaround, we can pass a timestamp in the payload to do so, but it would much better if it could work like on Android SDK. The sentTime property of the notification is passed in the Android SDK and the FlutterFire developers are able to pass it in the firebase_messaging plugin for Flutter.

Request :

Please add an equivalent property as this sentTime (the actual name of this property on Android is probably different but you see the meaning and i know it exists) on the iOS SDK.

If this property already exists on the iOS SDK, please accept my apologies and i would be glad to know which one it is.

Thanks in advance !

Tom3652 avatar Dec 30 '21 18:12 Tom3652

Thanks for your feedback. We will bring the request to the FM team.

In the meantime, there's a workaround since all the info is passed within the payload. You can access the "sentTime" through the "google.c.a.ts" key in the Message payload.

charlotteliang avatar Dec 30 '21 20:12 charlotteliang

Thanks for the quick reply.

The developer said this regarding this issue.

It seems that this property is also unavailable in newer iOS versions.

Can you confirm that this property is still available ?

Tom3652 avatar Dec 30 '21 20:12 Tom3652

I just tested and it should be available. Are you using console or sender API to send notifications?

charlotteliang avatar Dec 30 '21 20:12 charlotteliang

I am using the sender API and i guess the firebase team for flutter as well :)

Tom3652 avatar Dec 30 '21 20:12 Tom3652

@Tom3652 I'm able to reproduce that HTTP v1 Sender API does not provide "google.c.a.ts" send time. I will check with our team and get back to you.

charlotteliang avatar Dec 30 '21 21:12 charlotteliang

Hey @chliangGoogle, whilst at properties passed along via Firebase Messaging, there is also another property that is not being received which is the "topic" (or perhaps you can point us in the right direction t find the topic 😄).

So, if a device receives a message via a topic subscription, the topic name isn't found on the userInfo here.

In contrast, we are receiving the topic name on android here.

russellwheatley avatar Jan 04 '22 13:01 russellwheatley

Hello, is there any news regarding this issue ?
Thanks !

Tom3652 avatar Feb 25 '22 14:02 Tom3652

I don't believe this issue is still exists in new version of iOS. many values are null. iOS version 14.8.1 and firebase_messaging version is 12.0.1. I am using FCM rest api for sending notification Screenshot 2022-08-07 at 3 49 38 PM .

Faiizii avatar Aug 07 '22 11:08 Faiizii

We are already in the year 2023 and until today we do not have a simple solution for an issue created in 2021 :man_facepalming:

thiagotalma avatar Jan 25 '23 01:01 thiagotalma

We are already in the year 2023 and until today we do not have a simple solution for an issue created in 2021 🤦‍♂️

agree. i still cant find solution for ios.

acheyfaiz avatar Mar 28 '23 02:03 acheyfaiz

@Tom3652 I'm able to reproduce that HTTP v1 Sender API does not provide "google.c.a.ts" send time. I will check with our team and get back to you.

Can someone get back to me on this ? i mean i may be wrong but this seems to be an easy thing to fix

Also, as per as the quoted comment it seems to be a bug rather than a feature request

Tom3652 avatar Jun 12 '23 15:06 Tom3652

So this issue is still persisting, I am still seeing the sentTime being null on iOS.

DooMMasteR avatar Jan 15 '24 14:01 DooMMasteR