[英]How to add Apple Push Notifications support to self hosted Parse server on Heroku?
[英]Adding push notifications to Parse server hosted on Heroku crashing
我在Heroku上托管了一個簡單的Parse服務器,並且正在嘗試在其上設置Apple Push Notifications。
我的.p12文件已正確導出,我正在嘗試將其添加到index.js文件中。
這是我的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
}
}
});
這是我的服務器目錄http://imgur.com/a/ZDm6N
如果我評論整個push: {}
部分,當我部署到heroku時,服務器將正確啟動。 但是,如果我取消注釋,並且我認為所有信息都是正確的,則會給我一個應用程序錯誤,並拒絕加載。
我不知道對此有何改變,我想不起其他任何事情。 謝謝!
修復! 在push: {}
之前,我缺少逗號push: {}
info。
您的“ pfx”應為:pfx:“ certificates / lafcert.p12”
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.