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"