Android | NativeScript |通知 - 带领,徽章,设置

时间:2018-03-12 08:36:21

标签: angular push-notification firebase-cloud-messaging nativescript angular2-nativescript

我正在开发移动应用程序,在客户端使用nativescript和angular,在服务器上使用node.js。 我试图在Android平台上实现推送通知。我在后端使用firebase插件 - fcm-node,在移动端使用nativescript push notifications插件。

当我收到新通知时,声音和振动正在起作用,但是指示灯未亮起。 另外,我想在发射器上的app图标上显示徽章计数器,这是可能的。

这是在服务器端运行的代码,并设置通知设置。

publishNotification(userToken, notification, data, callback) {    
let message = {
    to: userToken,
    notification: {
       title: 'Title',
       body: 'Body',
       message: 'Message',
       sound = 'default',
       color = '#9bcb4d';
       priority = "high";
    },
    data: data
};

FirebasePublisher.fcm.send(message, callback);
}

提前致谢。

0 个答案:

没有答案