【问题标题】:FCM push notification with parse server带有解析服务器的 FCM 推送通知
【发布时间】:2019-02-23 14:09:54
【问题描述】:

我需要在解析服务器设置中添加 FCM 推送。请帮帮我。

但是从解析发送时。那么解析服务器和 FCM 之间存在一些问题。

这是我的 index.js,示例代码:

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);

请检查并帮助我。如何在解析服务器中添加 FCM 连接。

【问题讨论】:

  • 你到底有什么问题?
  • @AlexanderGutenev 我想在解析服务器中添加 fcm 服务器密钥。

标签: parse-platform push-notification parse-server


【解决方案1】:

对于 ios 配置,我可以看到 2 个错误:

  • pfx 路径可能是错误的,并且不会在服务器上工作导致它不是相对的(即,特定于您的本地计算机)。将文件保存在您获得 nodejs 代码的“certs”(或任何您想要的名称)文件夹中。然后更新pfx: __dirname + '/certs/push_crt.p12'
  • bundleId 不是正确的密钥,应该更新为 topic: 'com.example'

对于android 配置,我不确定senderId 的用途,也许你应该去掉它,除非你确定你需要它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-02-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-27
    • 1970-01-01
    • 2019-06-10
    • 1970-01-01
    相关资源
    最近更新 更多