iva*_*esi 5 firebase flutter firebase-ab-testing
我正在为我的 Flutter 应用程序创建 Firebase 远程配置实验和 A/B 测试。为了验证测试设备上的实验,我需要获取Firebase installation auth token与每个 Firebase 安装关联的实验。
如何在“Flutter-way”中获取这个token?在文档中,有办法为 Swift、Kotlin 等获取它。但不适用于 Dart/Flutter。
在我的应用程序中,我firebase_core安装了软件包,FirebaseOptions 有一堆 id:
this.apiKey,
this.appId,
this.messagingSenderId,
this.projectId,
this.measurementId,
Run Code Online (Sandbox Code Playgroud)
但没有 Firebase安装身份验证令牌。
最简单的方法是,如果您还安装了 firebase 云消息传递,则从那里获取令牌。在我的应用程序中,我没有,所以我想自己解决这个问题,所以我编写了一个小包来解决这个问题。
我不确定它是否适用于任何类型的设备,因为我只在我拥有的设备(Android 和 iOS)上本地尝试过,但使用此令牌您可以在 firebase 控制台中进行 AB 测试。
https://pub.dev/packages/firebase_device_id