我正在尝试使用我的云代码发送iOS推送通知(我不能使用解析器的推送API,因为我的应用程序是用ionic构建的,而他们所有的文档都是原生的)。
我使用nodejs在本地将其作为独立脚本工作,但当我上传它进行解析时,我得到:
Uploading source files
Note that the following files will not be uploaded:
parse_cloud_code/cloud/cloud/cert.pem
parse_cloud_code/cloud/cloud/key.pem
Uploading recent changes to scripts...
The following files will be uploaded:
parse_cloud_code/cloud/cloud/cloud.js
parse_cloud_code/cloud/cloud/cloud_test.js
parse_cloud_code/cloud/cloud/credentials.js
parse_cloud_code/cloud/cloud/fs.js
parse_cloud_code/cloud/cloud/push-notification.js
parse_cloud_code/cloud/cloud/push-notifications_test.js
parse_cloud_code/cloud/cloud/tls.js
Finished uploading files
Error: Failed to load cloud/cert.pem with: Could not find file cloud/cert.pem
at Object.exports.readFile (cloud/fs.js:24:17)
at readFile (cloud/push-notification.js:45:8)
at body (cloud/push-notification.js:56:5)
at cloud/push-notification.js:147:3
at cloud/push-notification.js:156:3
at cloud/cloud.js:5073:5
at cloud/cloud.js:5082:3
at main.js:1:13
如何将.pem
文件放入云代码中?我尝试将它们重命名为.js
,但随后解析希望它们实际上在语法上是JS文件。想象一下。
发布于 2015-08-21 20:53:57
我找到了解决这种情况的方法,因为我也有类似的问题。任何非js文件,我必须上传,我会重命名为.ejs。所以解析CLI会上传它,你可以在你的云代码中使用它。
https://stackoverflow.com/questions/30210017
复制相似问题