msh_mesg_tracking_v2 0.0.2 copy "msh_mesg_tracking_v2: ^0.0.2" to clipboard
msh_mesg_tracking_v2: ^0.0.2 copied to clipboard

outdated

An Flutter plugin for log tracking.

msh_mesg_tracking_v2 Flutter Plugin #

1. Requirement #

  • Android min API: 16
  • iOS min version: 9.0

2. Install #

Get package from pub.dev pubspec.yaml

dependencies:
  msh_mesg_tracking_v2: ${lastes_version}

Set permission for Android

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Set allow http internet for iOS info.plist

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

3. Example #

Init plugin mess_log_tracking_v2

MessLogTrackingV2 _messLogTrackingV2 = MessLogTrackingV2().initialized();

3.1 Method getLibVersion #

This method use to get version of lib tracking. This method return lib version of lib tracking.

 // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> getVersionLib() async {
    String version = await messLogTrackingV2.getLibVersion;

    setState(() {
      _libVersion = version;
      _log = "$_log\nGet version lib: $version";
    });
  }

3.2 Method getDeviceID #

This method use to get information DeviceID of device. This method return deviceID.

Example:

// Platform messages are asynchronous, so we initialize in an async method.
  Future<void> getUUID() async {
    String deviceId = await messLogTrackingV2.getUUID;

    setState(() {
      _deviceId = deviceId;
      _log = "$_log\nGet deviceId: $deviceId";
    });
  }

3.4. Method handleAppOpen #

Tracking app when close app.

Example Future

setState(() {
  _log = "$_log\n _handleAppOpen";
});

}

### 3.3. Method ```handleAppQuit```
Tracking app when close app.

**Example**
  Future<void> handleAppQuit() async {
    var result = await messLogTrackingV2.handleAppQuit();

    setState(() {
      _log = "$_log\n _handleAppQuit: $result";
    });
  }

3.4. Method sendLogAction #

Tracking time use apps. This method called when app start & finish app.

Field Description
isClosed 0: Log open - 1: log close - 2: log update source
ext Field extend data parameter, separate by “;”. Ext: 3646;iwida.
If you not use this method, parameter string empty (“”).

Response:

  • true : When send log failed
  • false : When send log failed

Example

bool _sendLogAction = false;
Future<void> sendLogAction() async {
    bool result = await messLogTrackingV2.sendLogAction("1", "ext");

    setState(() {
      _sendLogAction = result;
      _log = "$_log\nAction SEND - sendLogAction: $result";
    });
  }

3.5 Method sendLogClickBanner #

This method use to tracking click ads in apps.

Using:

Each one ads will be given one app_id. When click to ads.

  • Need parameter activity present: package + activity Ex: vcc.soha.game.DetailsActivity
  • currentAction: click("0") or view ("1") Parameters:
Field Description
app_id App_id of Ads
currentActivity Activity present container Ads, include: package name + name ActivityEx: vcc.soha.game.DetailsActivity
currentAction Click ads input currentAction = “0”, view ads input currentAction = “1”
ext Field extend data parameter, separate by “;”. Ext: 3646;iwida.
If you not use this method, input string empty (“”).

Response:

  • true : When send log failed
  • false : When send log failed

Example

  Future<void> sendLogClickBanner() async {
    bool result = await messLogTrackingV2.sendLogClickBanner("app_id",
        "vcc.soha.game.DetailsPage", "0", "ext-sample");

    setState(() {
      _log = "$_log\nAction SEND - sendLogClickBanner: $result";
    });
  }

3.6 Method sendLogConfirm #

This method use to apps have install mini, need update data before start.

This method use to apps have install mini, need update data before start. Using

  • With app installed and have not logged in. This func will be called when initiate login form.
  • With app installed and logged in, token will be saved to local, so when App version update, the first time app lauched will look for saved token in local.

Parameters:

Field Description
ext Field extend data parameter, separate by “;”. Ext: 3646;iwida.
If you not use this method, input string empty (“”).

Response:

  • true : When send log failed
  • false : When send log failed

3.7 Method sendLogTrackingView #

This method use to tracking Ads.

Example

Future<void> sendLogTrackingViewWithParams( json) async {
    bool result = await messLogTrackingV2.sendLogTrackingViewWithParams(json);
    setState(() {
      _log = "$_log\nAction SEND - sendLogTrackingViewWithParams: $result";
    });
  }

Response:

  • true : When send log failed
  • false : When send log failed

4. Author #

License #

msh_mesg_tracking_v2 is available under the MIT license. See the LICENSE file for more info.

1
likes
0
pub points
0%
popularity

Publisher

unverified uploader

An Flutter plugin for log tracking.

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on msh_mesg_tracking_v2