flutter_growingio_track 0.0.3

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 70

flutter_growingio_track #

VersionPub

GrowingIO的埋点版本flutter插件.

一: 集成 #

1. Flutter插件获取安装 #

根据dart pub文档获取安装

2. Android集成(Native部分) #

此Flutter插件运行在Android手机上时依赖于GrowingIO Android SDK(可以是无埋点SDK也可以是埋点SDK)2.6.0及以上, 原生部分请参考Android官方文档集成SDK部分(无埋点)Android官方文档集成SDK部分(埋点)接入集成.

可以参考仓库中的example项目.

3. iOS集成(Native部分) #

1, 选择SDK集成方式 (1).>使用 CocoaPods 快速集成

 >添加pod 'GrowingCoreKit' 到Podfile中
 >执行pod update,不要用--no-repo-update选项
 

(2).手动集成方式

>获取sdk zip包,解压iOS SDK压缩文件
>将Growing.h 和GrowingCoreKit添加到iOS工程  

2,设置URL Scheme与初始化SDK(必选)

  参考官网文档:https://docs.growingio.com/docs/sdk-integration/ios-sdk/#2-she-zhi-url-scheme

4. Tips #

4.1 IOS: App Store 提交应用 #

如果您添加了库AdSupport.framework, GrowingIO则会启用 IDFA,所以在向 App Store 提交应用时,需要:

  • 对于问题 Does this app use the Advertising Identifier (IDFA),选择 YES。
  • 对于选项Attribute this app installation to a previously served advertisement,打勾。
  • 对于选项Attribute an action taken within this app to a previously served advertisement,打勾。

4.2 IOS: 为什么 GrowingIO使用IDFA #

GrowingIO 使用 IDFA 来做来源管理激活设备的精确匹配,让你更好的衡量广告效果。如果你不希望跟踪这个信息,可以选择不引入 AdSupport.framework

4.3 Android: 初始化Android SDK时, GrowingIO类可能会报红色 #

这个应该是Flutter项目结构的问题, 并不影响运行, 可以放心编译. 不过需要手动import-_-|

4.4 为什么不在flutter中单独初始化 #

  • 因为GrowingIO需要获取Android的Activity生命周期, 为了数据的准确性, 需要在Activity出现前就初始化完成
  • 开发者相信很多用户都会使用flutter + native形式的进行开发, 为了同时服务flutter于native

二: API #

在dart中调用GrowingIO的函数, 需要先import对应的包

import 'package:flutter_growingio_track/growingio_track.dart';

具体参数限制请参见GrowingIO官网文档。

  1. track发送自定义事件, 对应于cstm事件

    参数是否必填说明
    eventId事件Id
    num数值, double型
    variable变量, Map型

    调用示例:

    import 'package:growingioflutter/growingio_track.dart';
    
    GrowingIO.track('eventId');
    GrowingIO.track('testEventId', num: 23.0, variable: {'testKey': 'testValue', 'testNumKey': 233});
    GrowingIO.track('eventId', num: 23.0);
    GrowingIO.track('eventId', variable: {'testkey': 'testValue', 'testNumKey': 2333});
    
  2. setEvar发送转化变量, 对应于evar事件

    函数原型为: setEvar(Map<String, dynamic> variable), 调用示例:

    GrowingIO.setEvar({
      'testKey': 'testValue', 'testNumKey': 2333.0
    });
    
  3. setPeopleVariable发送用户变量, 对应于ppl事件

    函数原型为: setPeopleVariable(Map<String, dynamic> variable)

    调用示例:

    GrowingIO.setPeopleVariable({
      'testKey': 'testValue', 'testNumKey': 2333.0
    });
    
  4. setUserId设置登录用户Id, 对应于cs1字段

    参数类型描述
    userIdString登录用户Id

    函数原型: setUserId(String userId)

    调用示例:

    GrowingIO.setUserId("testUserId");
    
  5. clearUserId清楚登录用户Id

    函数原型: clearUserId()

    调用示例:

    GrowingIO.clearUserId();
    
  6. setVisitor设置访问用户变量, 对应于vstr事件

    函数原型: setVisitor(Map<String, dynamic> variable)

    调用示例:

    GrowingIO.setVisitor({
          "visitorKey": 'key', "visitorValue": 34
        });
    

0.0.1 #

  • TODO: Describe initial release.

example/README.md

flutter_growingio_track_example #

Demonstrates how to use the flutter_growingio_track plugin.

Getting Started #

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_growingio_track: ^0.0.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_growingio_track/flutter_growingio_track.dart';
  
Version Uploaded Documentation Archive
2.6.0 Nov 8, 2018 Go to the documentation of flutter_growingio_track 2.6.0 Download flutter_growingio_track 2.6.0 archive
0.0.3 Nov 6, 2018 Go to the documentation of flutter_growingio_track 0.0.3 Download flutter_growingio_track 0.0.3 archive
0.0.2 Nov 6, 2018 Go to the documentation of flutter_growingio_track 0.0.2 Download flutter_growingio_track 0.0.2 archive
0.0.1 Nov 6, 2018 Go to the documentation of flutter_growingio_track 0.0.1 Download flutter_growingio_track 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
44
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
70
Learn more about scoring.

We analyzed this package on Feb 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.13+1
  • Flutter: 1.2.1

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

9 out of 9 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8