fl_baidu_mob_stat_ys 1.2.3 copy "fl_baidu_mob_stat_ys: ^1.2.3" to clipboard
fl_baidu_mob_stat_ys: ^1.2.3 copied to clipboard

参考 fl_baidu_mob_stat,感谢作者大佬。代码仓库地址参考大佬地址。

fl_baidu_mob_stat_ys #

百度移动统计Flutter插件

运行 Example 查看 事例

查看全部API

开始使用 #

  • 注册key
Future<void> fun() async {
  final bool key = await FlBaiduMobStat().setApiKey(
      androidKey: 'androidKey', iosKey: 'iosKey');
     print('初始化是否成功:$key');
}

  • 设置channel (可选)
Future<void> fun() async {
   final bool channel = await FlBaiduMobStat().setAppChannel(channelName);
   print('设置channel:$channelName = $channel');
}

  • 设置version (可选)
Future<void> fun() async {
    final bool version = await FlBaiduMobStat().setAppVersionName('1.0.0');
    print('设置version name:$version');
}

  • 是否开启debug模式 (可选)
Future<void> fun() async {
     final bool debug = await FlBaiduMobStat().setDebug(true);
     print('设置是否开启debug模式:$debug');
}

  • 获取SDK生成的设备的测试ID
Future<void> fun()async{
   final String? id = await FlBaiduMobStat().getTestDeviceId();
}
  • 获取SDK生成的设备的cuId (android 上获取为空字符串)
Future<void> fun()async{
   final String? id = await  FlBaiduMobStat().getDeviceCuId();
}
  • 记录一次事件的点击。
Future<void> fun()async{
   final bool state = await FlBaiduMobStat().logEvent(
                       eventId: 'Event1',
                       attributes: <String, String>{'k1': 'v1', 'k2': 'v2'});
}
  • 记录一次事件的时长。
Future<void> fun()async{
   final bool state = await FlBaiduMobStat().logDurationEvent(
                     eventId: 'Event2',
                     duration: 3000,
                     label: 'event',
                     attributes: <String, String>{'k1': 'v1'});
}
  • 记录一次事件的开始。
Future<void> fun()async{
   final bool state = await FlBaiduMobStat().eventStart(eventId: 'Event3');
}
  • 记录一次事件的结束。
Future<void> fun()async{
   final bool state = await FlBaiduMobStat().eventEnd(
                       eventId: 'Event3',
                       attributes: <String, String>{'k1': 'v1'});
}
  • 记录某个页面访问的开始。
Future<void> fun()async{
   final bool state = await FlBaiduMobStat().pageStart('AnotherPage');
}
  • 记录某个页面访问的结束。
Future<void> fun()async{
   final bool state = await FlBaiduMobStat().pageEnd('AnotherPage');
}
1
likes
140
points
22
downloads

Publisher

unverified uploader

Weekly Downloads

参考 fl_baidu_mob_stat,感谢作者大佬。代码仓库地址参考大佬地址。

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

flutter

More

Packages that depend on fl_baidu_mob_stat_ys