Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Background notification OK, but event "notification" never called #387

Closed
@cmillauriaux

Description

Hi everyone,

I installed the plugins and configure android notifications, but, when i send a notification from my server (node-gcm), the notification is shown in the navbar like the application is in the background. If i click in this notification, nothing happened. The most important is if i add a console.log instruction in the "notification" event, nothins is print in the console. So, i think my notification message is never catch by the plugin. Any idea ?

Server message :

var message = new gcm.Message({
      collapseKey: "applice",
      delayWhileIdle: true,
      timeToLive: 3,
      notification: {
        title: "Hello, World",
        icon: "icon",
        message: "This is a notification that will be displayed ASAP."
      }
    });

Client side :

self.push = PushNotification.init({
        android: {
          senderID: "blablablabla"
        }
      });

      self.push.on('registration', function(data) {
        console.log('REGISTRATION : ' + JSON.stringify(data));
        if (data && data.registrationId && data.registrationId.length >
          0) {
          // Call token server update
        }
      });

      self.push.on('notification', function(data) {
        console.log('MESSAGE : ' + JSON.stringify(data));
        // Call client user refresh
      });

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions