Receive GCM push notification in node.js app

后端 未结 5 1381
慢半拍i
慢半拍i 2021-01-02 12:22

I\'m building a command-line application in node.js and would like to receive GCM push notifications (the command-line app will be interacting with the same set of services

5条回答
  •  既然无缘
    2021-01-02 12:48

    It's not mandatory to depend only on GCM, today there are many packages are available for sending pushNotification.

    Two node packages are listed below.

    • fcm-call - you can find documentation from https://www.npmjs.com/package/fcm-call
    • fcm-node

    fcm-call is used - you can find documentation from https://www.npmjs.com/package/fcm-node/

    let FCM = require('fcm-call');
    const serverKey = ''; 
    const referenceKey = ''; //Device Key
    let title = '';
    let message = '';
    
    FCM.FCM(serverKey, referenceKey, title, message);
    

    And Your notification will be sent within 2-3 seconds.

    Happy Notification.

提交回复
热议问题