我正在尝试实现一个在新版本发布后(换句话说,一旦我的 Firebase 部署完成部署所有更改)就会触发的函数。Firebase 支持这种可能性吗?我想在发布新版本后为我的应用程序启用实时更新。
// on new version release
exports.onHostingRelease = functions
.runWith({ timeoutSeconds: 540, memory: '2GB' })
.hosting.site('your-site-name')
.onRelease((versionMetadata) => {
// versionMetadata is an object that contains information about the new version
console.log('New version deployed:', versionMetadata.versionString);
// You can perform any actions you need here, such as sending a notification
// or updating a database record
return null;
});