简体   繁体   English

将推送通知添加到托管在Heroku崩溃的Parse服务器上

[英]Adding push notifications to Parse server hosted on Heroku crashing

I have a simple Parse server hosted on Heroku, and I'm trying to setup Apple Push Notifications on it. 我在Heroku上托管了一个简单的Parse服务器,并且正在尝试在其上设置Apple Push Notifications。

I have my .p12 file exported correctly, and I'm trying to add it into the index.js file. 我的.p12文件已正确导出,我正在尝试将其添加到index.js文件中。

Here is my that section of my index.js file: (all XXX 's are my sensitive data commented out just for this post, those sections are working correctly. 这是我的index.js文件的这一部分:(所有XXX都是我为这篇文章而注释掉的敏感数据,这些部分正常工作。

var api = new ParseServer({
databaseURI: databaseUri || 'XXX',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID || 'XXX',
masterKey: process.env.MASTER_KEY || 'XXX', //Add your master key here. Keep it secret!
serverURL: process.env.SERVER_URL || 'XXX',  // Don't forget to change to https if needed
liveQuery: {
classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions
}

push: {
    ios: {
        pfx: '/certs/lafcert.p12', // the path and filename to the .p12 file you exported earlier. 
        bundleId: 'XXX', // The bundle identifier associated with your app
        production: false // Specifies which environment to connect to: Production (if true) or Sandbox
    }
}
});

And Here is my server directory http://imgur.com/a/ZDm6N 这是我的服务器目录http://imgur.com/a/ZDm6N

If I comment the whole push: {} section out, when I deploy to heroku the server launches correctly. 如果我评论整个push: {}部分,当我部署到heroku时,服务器将正确启动。 However, if I uncomment it out, and I think all the information is correct, it gives me an application error, and refuses to load. 但是,如果我取消注释,并且我认为所有信息都是正确的,则会给我一个应用程序错误,并拒绝加载。

I don't know what to change about this, I can't think of anything else to do. 我不知道对此有何改变,我想不起其他任何事情。 Thanks! 谢谢!

Fixed it! 修复! I was missing a comma before the push: {} info. push: {}之前,我缺少逗号push: {} info。

您的“ pfx”应为:pfx:“ certificates / lafcert.p12”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM