1
votes

I need to add FCM push in parse server setting. Please help me.

However when sending from parse. There is some issue between parse server and FCM then.

Here is my index.js, sample code:

var express = require("express");
var ParseServer = require("/usr/lib/node_modules/parse-server").ParseServer;
var ParseDashboard = require("/usr/lib/node_modules/parse-dashboard");

var allowInsecureHTTP = true;

var api = new ParseServer({
  databaseURI: "mongodb://127.0.0.1:27017/****",
  appId: "****",
  masterKey: "****",
  serverURL: "http://**.**.**.**:1234/parse",

  push: {
    ios: {
      pfx: "/usr/lib/node_modules/push_crt.p12",
      passphrase: "example",
      bundleId: "com.example",
      production: true
    },
    android: {
      senderId: "123456",
      apiKey: "******"
    }
  }
});

var dashboard = new ParseDashboard(
  {
    apps: [
      {
        serverURL: "http://**.**.**.**:1234/parse",
        appId: "******",
        masterKey: "******",
        appName: "MyApp"
      }
    ],
    users: [{ user: "admin", pass: "admin" }]
  },
  allowInsecureHTTP
);

var app = express();

// make the Parse Server available at /parse
app.use("/parse", api);

// make the Parse Dashboard available at /dashboard
app.use("/dashboard", dashboard);

var httpServer = require("http").createServer(app);
httpServer.listen(1234);

Please check and help me. How to add FCM connection inside parse server.

1
What exactly issue you have? - Alex Guteniev
@AlexanderGutenev i want to add fcm server key in parse server. - user10851063

1 Answers

0
votes

For the ios configuration, I can see 2 errors:

  • pfx path is probably wrong and that wont work on a server cause its not relative (ie. thats specific to your local computer). Save the file in a "certs" (or whatever you wanna call it) folder where you got the nodejs code. Then update with pfx: __dirname + '/certs/push_crt.p12'
  • bundleId is not the right key, this should be updated to topic: 'com.example'

For the android config, im not sure what senderId is for, maybe you should get rid of that, unless you are sure you need it.