【发布时间】:2021-02-03 07:36:35
【问题描述】:
我正在后端部分使用 Firebase 制作应用程序。用户可以使用谷歌账号登录myApp,并可以备份自己的数据。
当用户卸载 myApp 时,我想在云端删除一些文档。collection ID 是用户电子邮件。
所以我需要知道用户电子邮件,但我不知道如何获取。
exports.appUninstall = functions.analytics.event("app_remove").onLog((event)=>{
const userEmail = event.user.email;
database.doc(userEmail + "/user_logged_in").delete();
return console.log("Deleted user_logged_in because user uninstalled app");
});
【问题讨论】:
标签: firebase google-cloud-firestore google-cloud-functions