C Theja Varaprasad
C Theja Varaprasad

Reputation: 1

Electron Push Reciver With Latest Firebase APIs

Earlier we used the electron-push-receiver NPM package, Now these https://fcm.googleapis.com/fcm/connect/subscribe we are getting a 404 Error.

index.js file source

const uuidv4 = require('uuid/v4');
const { register: registerGCM } = require('../gcm');
const registerFCM = require('../fcm');

module.exports = register;

async function register(sender_id) {
  // Should be unique by app - One GCM registration/token by app/appId
  const appId = `wp:receiver.push.com#${uuidv4()}`;
  const subscription = await registerGCM(appId);
  const result = await registerFCM({
    token : subscription.token,
    sender_id,
    appId,
  });
  // Need to be saved by the client
  return Object.assign({}, result, { gcm : subscription });
}

What is the best package instead of "electron-push-receiver", suggest me.

Upvotes: 0

Views: 9

Answers (0)

Related Questions