Pet*_*ark 12 firebase google-cloud-functions
我在Firebase官方指南中找不到此用例的解决方案.
我的代码如下.提前致谢.
功能:
exports.myFunction = functions.https.onCall((data, context) => {
const id = context.auth.uid;
const message = data.message;
admin.firestore()...
// Do something with Firestore //
});
Run Code Online (Sandbox Code Playgroud)
客户来电:
const message = { message: 'Hello.' };
firebase.functions().httpsCallable('myFunction')(message)
.then(result => {
// Do something //
})
.catch(error => {
// Error handler //
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1345 次 |
| 最近记录: |