FCM in android notification displays 01/01/1970 or 50 years

76 views
Skip to first unread message

Qutub Mohamed N - iloads Associate Vice President

unread,
Aug 28, 2020, 12:09:22 PM8/28/20
to Firebase Google Group
Team,
I am sending Notification messages on Notification tag via FCM but on the Mobile end I am getting Message with 01/01/1970.

How to get Message with "Now" format.

I do not want 1/1/1970 or 50 years to be displayed in the Notification message

Appreciate your help in this regard

Here is code snippet

NotificationWrapper notificationWrapper = new NotificationWrapper();
CcsOutMessage ccsOutMessage = new CcsOutMessage();
Map<String, String> dataMap = new HashMap<>();
dataMap.put(DATA_MESSAGE, "Testing 1970 Date issue,CASE1 ");
dataMap.put(DATA_MESSAGEID, UUID.randomUUID().toString());
dataMap.put(DATA_MESSAGETIME, Instant.now().atOffset(ZoneOffset.UTC).toInstant().toString());
dataMap.put(DATA_HEADING, "order");
................................................
....................................................
dataMap.put(DATA_NOTIFICATIONTYPE, "BROADCAST_ALERT");
dataMap.put(DATA_EXPIRYTIME, "60000");
dataMap.put(DATA_TIMEZONE, "Asia/Kolkata");
ccsOutMessage.setDeliveryReceiptRequested(true);
// ccsOutMessage.setNotificationPayload(dataMap);
ccsOutMessage.setDataPayload(dataMap);
ccsOutMessage.setTimeToLive(600);

................................
............................
This is the information sent to FCM via my backend server
[recipients=[FCMUserToken],
ccsOutMessage=
CcsOutMessage [
to=null,
condition=null,
messageId=null,
collapseKey=null,
priority=high,
contentAvailable=null,
timeToLive=6000,
deliveryReceiptRequested=true,
dryRun=null,
dataPayload={
messageTime=2020-08-28T09:38:03.304Z,
heading=Order,
expiryTime=60000,
messageId=72708abc-34d7-4929-bd62-15a07c3e5c4c2020-08-28T09:38:03.304Z,
notificationType=BROADCAST_ALERT,
message=Hi all checking R.2020-08-28T09:38:03.304Z
},
notificationPayload={
messageTime=2020-08-28T09:38:03.304Z,
heading=Order,
expiryTime=60000,
messageId=72708abc-34d7-4929-bd62-15a07c3e5c4c2020-08-28T09:38:03.304Z,
notificationType=BROADCAST_ALERT,
message=Hi all checking R.2020-08-28T09:38:03.304Z
}
], appId=006]] as "application/json"



DISCLAIMER: This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.
Reply all
Reply to author
Forward
0 new messages