我想在iOS上设置一些推送警报
当用户在特定时间设置告警时,服务器通过调用Weather API (ex OpenweatherMap)发送天气数据。
是否可以在Firebase中使用云函数
发布于 2018-01-08 18:34:00
是的,这可以通过request模块来完成。
请参阅Use firebase cloud function to send POST request to non-google server,您可以在其中找到以下内容:
// import the module
var request = require('request');
// make the request
request('put your external url here', function (error, response, body) {
if (!error && response.statusCode == 200) {
//here put what you want to do with the request
}
})请注意,您必须激活一个付费计划,因为免费计划(Spark plan )只允许“只向Google拥有的服务发出网络请求”
另请注意,您必须先安装请求包,然后才能调用它,如上所示。
https://stackoverflow.com/questions/48148370
复制相似问题