2

I want to list more data like date, time in notification of chrome GCM push notification. As shown in my code here:

self.addEventListener('push', function(event) {
    console.log('Received a push message from local', event);

    var title = 'My title file. Testing on';
    var body = 'New Push Message.';
    var icon = 'refresh_blueicon.png';
    var tag = 'my-push-tag';

    event.waitUntil(fetch('http://localhost/pushMsg/Push_Notification/msg.php').then(function(response) {
        if (response.status !== 200) {
            console.log('Looks like there was a problem. Status Code: ' + response.status);
            throw new Error();
        }

        // Examine the text in the response
        return response.json().then(function(data) {
            self.registration.showNotification(data.title, {
                body: data.msg,
                icon: icon,
                tag: tag
            }) // here i want to add more, need to know what is possible to add
        })
    })
);

How do I add Date and Time in this notification window? Here is an example:

enter image description here

sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
Yogendra
  • 2,139
  • 3
  • 14
  • 27
  • As per the documentation [here](https://developer.chrome.com/apps/notifications) the only option I see is `eventTime` however, that only shows time in milliseconds past the epoch time. Which is the only NotificationOption relating to any time event in GCM. However, [this](https://github.com/google/gcm/issues) might be a better repository to help answer/ask your question. – pointNclick Sep 29 '15 at 00:44

0 Answers0