找到證書文件我使用的APN模塊(https://github.com/argon/node-apn),以推送通知從發送的NodeJS到iPhone。APN的NodeJS模塊無法在Ubuntu上
我的代碼在我的開發計算機(Mac OSX)上正常工作,並通過Apple沙箱網關(gateway.sandbox.push.apple.com)成功推送通知,但是當我將其移動到登臺服務器時運行Ubuntu)推通知失敗的消息:
Error: ENOENT, no such file or directory 'apns-dev-cert.pem'
我建立的NodeJS APN對象,例如:
var options = {
cert: "apns-dev-cert.pem",
key: "apns-key.pem",
passphrase: null,
gateway: "gateway.sandbox.push.apple.com",
port: 2195,
enhanced: true,
errorCallback: undefined,
cacheLength: 5
};
在我開發的Mac OSX的機器,該證書被安裝在鑰匙串。從我對Ubuntu的有限理解來看,相當於將證書文件複製到/ etc/ssl/certs。我嘗試這樣做,並且在我的NodeJS代碼中將路徑更改爲「/etc/ssl/certs/apn-dev-cert.pem」,但出現相同的錯誤消息。
任何想法?
保持你的pem文件,你保存上述源文件,並嘗試!!!! –