Giter VIP home page Giter VIP logo

fl_umeng's Introduction

友盟统计 for Flutter

开始使用

  • 注册友盟
Future<void> initState() async {
  /// 注册友盟 统计 性能检测
  final bool? data = await FlUMeng().init(
      androidAppKey: '5f8fe2abfac90f1c19a8642e',
      iosAppKey: '5f8fe4d4c1122b44acfc7aa7',
      channel: 'channel');
  print('UMeng 初始化成功 = $data');
}
  • 设置账号
  
void fun(){
    /// 是否开启log 仅支持 Android
  FlUMeng().setLogEnabled(true);

   /// 设置用户账号
  FlUMeng().signIn('userID');

   /// 取消用户账号
  FlUMeng().signOff();

}
  • 发送自定义事件
   /// 发送自定义事件(目前属性值支持字符、整数、浮点、长整数,暂不支持NULL、布尔、MAP、数组)
void fun(){
  FlUMeng().onEvent();
}
  • 使用页面统计
void fun(){
   /// 如果需要使用页面统计,则先打开该设置
  FlUMeng().setPageCollectionModeManual();

   /// 如果不需要上述页面统计,在完成后可关闭该设置;如果没有用该功能可忽略;
  FlUMeng().setPageCollectionModeAuto();

   /// 进入页面统计 
  FlUMeng().onPageStart();

   /// 离开页面统计
  FlUMeng().onPageEnd();

}
  • 错误发送
void fun(){
    /// 错误发送  仅支持 Android
  FlUMeng().report Error();
}

android 如遇到 Duplicate class com.google.common.util.concurrent.ListenableFuture的错误

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules jetified-guava-20.0.jar (com.google.guava:guava:20.0) and jetified-listenablefuture-1.0.jar (com.google.guava:listenablefuture:1.0)

  Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.

android/app/build.gradle 添加以下代码

configurations {
    all*.exclude group: 'com.google.guava', module: 'listenablefuture'
}

fl_umeng's People

Contributors

wayaer avatar wanghuasheng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.