简体   繁体   中英

How to get firebase installation auth token in flutter app?

I'm creating Firebase Remote config experiment with A/B testing for my Flutter app. For validating the experiment on test device I need to get Firebase installation auth token that associated with each Firebase installation.

How can I get this token in "Flutter-way"? In docs there is way to get it for Swift, Kotlin etc.. But not for Dart/Flutter.

In my app I have firebase_core package installed and FirebaseOptions has a bunch of ids:

this.apiKey,
this.appId,
this.messagingSenderId,
this.projectId,
this.measurementId,

But no Firebase Installation Auth Token.

The easiest way is if you've got the firebase cloud messaging installed as well, getting the token from there. In my app I didn't so I wanted to figure this out myself so I wrote a small package to solve this.

I'm not sure if it works on any type of device as I've only tried it locally on the devices I have (Android and iOS) but using this token you can do the AB testing in firebase console.

https://pub.dev/packages/firebase_device_id

firebase_app _installations是 Firebase 开发团队的一个新的 Flutter 包,我相信它会为您提供所需的东西。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM