Flutter & Firebase - Firebase Analytics setUserProperty for Anonymous users

Posted

技术标签:

【中文标题】Flutter & Firebase - Firebase Analytics setUserProperty for Anonymous users【英文标题】:Flutter & Firebase- Firebase Analytics setUserProperty for Anonymous users 【发布时间】:2021-04-16 06:53:04 【问题描述】:

无法设置用户属性 - 在 Flutter Web 中获取 TypeError: Cannot read property 'statusCode' of null

【问题讨论】:

【参考方案1】:

尝试做

WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  UserCredential userCredential = await FirebaseAuth.instance.signInAnonymously();
  FirebaseAnalytics analytics = FirebaseAnalytics();
analytics.setUserId(userCredential.user.uid);
analytics.setUserProperty(name:"xxxx",value:"xxxxx");

【讨论】:

以上是关于Flutter & Firebase - Firebase Analytics setUserProperty for Anonymous users的主要内容,如果未能解决你的问题,请参考以下文章

Flutter & Firebase:如何检查某个项目是不是存在于 Firebase 文档中的数组中

Flutter & firebase - StreamBuilder 未加载

Flutter 2 - firebase_remote_config 0.6.0 & firebase_core ^0.7.0 版本冲突

Flutter & Firebase - 从文档中获取特定字段

检查用户是不是登录 Flutter & firebase auth |

从 QuerySnapshot 和 Listview Builder (Flutter & Firebase) 中排除文档