apptics_flutter 0.0.1 copy "apptics_flutter: ^0.0.1" to clipboard
apptics_flutter: ^0.0.1 copied to clipboard

Flutter plugin for Zoho Apptics SDK.

Apptics Flutter #

Flutter library for Apptics, wrapper around Apptics Native iOS and Android SDK. Supports tracking in-app events, screens and session.

Install Apptics

Run this command:

With Flutter:

$ flutter pub add apptics_flutter ^0.0.1

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  apptics_flutter: ^0.0.1

Alternatively, your editor might support flutter pub get.

Android initialization steps #

  1. Register your app and download apptics-config.json from Apptics web console.

  2. Place apptics-config.json file in app/ directory (Root of the Android Studio app module).

  3. Add apptics-plugin classpath and zoho maven url in project level build.gradle

    buildscript {
        repositories {
            maven {
                url "https://maven.zohodl.com/"
            }
        }
        dependencies {
            classpath 'com.zoho.apptics:apptics-plugin:0.1'
        }
    }
    
  4. Apply apptics-plugin and enable event tracking in app level gradle (app/build.gradle)

    apply plugin: "com.android.application"
    apply plugin: "apptics-plugin"
    
    apptics {
        supportEventAsStrings = ["default":true]
    }
    
  5. Rebuild the Android project. (Build -> Rebuild in Android Studio)

  6. Initialize Apptics in MainApplication.kt onCreate() method.

    AppticsAnalytics.init(this)
    AppticsCrashTracker.init(this)
    AppticsEventsIdMapping().init()
    

Initialization steps for Apple platforms

  1. Register your app and download apptics-config.plist from Apptics web console.
  2. Once you have created the Project and added your app, download the apptics-config.plist, move the file into the Xcode project root folder, and add the config file to the main target.
  3. Add pre-build scripts to your Podfile.
source 'https://github.com/CocoaPods/Specs.git'
  target 'MAIN TARGET' do

    # Pre build script will register the app version, upload dSYM file to the server and add apptics specific information to the main info.plist which will be used by the SDK.
    script_phase :name => 'Apptics pre build', :script => 'sh "./Pods/Apptics-SDK/scripts/run" --upload-symbols-for-configurations="Release, Appstore"', :execution_position => :before_compile

  end

Important:

  • Adding pre-build scripts is mandatory.
  • In the pre-build script, we upload dSYM to the server (optional), register the app with the Apptics server, and add the necessary information of the app version into the apptics-config.plist which is used by the SDK to send the data to the Apptics server.
  • Always make sure 'Copy Bundle Resources' is below the 'Compile Sources' and '[cp-user] Apptics pre build' is above 'Compile Sources'.

Build script usage:

run --upload-symbols-for-configurations="Release, Appstore" --config-file-path="YOUR_PATH/apptics-config.plist" --app-group-identifier="group.com.company.application [Optional]"

  • --config-file-path pass your config file path if it is not added to your project root.
  • --app-group-identifier if you have enabled app group identifier for your app's target.
  • --upload-symbols-for-configurations String, an optional parameter to pass your configuration name debug, release, or add a custom name with comma-separated for which the dSYMs will be uploaded without any prompt during App Store submission process via CI, CT, and CD.

For more details on how to configure for multiple projects please visit iOS user guide

4. Build the Xcode project and check for any issues.

Create AppticsFlutter instance

import 'package:apptics_flutter/apptics_flutter.dart';

final _appticsFlutterPlugin = AppticsFlutter();

Event Tracking

  1. Configure custom events in Apptics webconsole.
  2. Track the configured event with properties using addEvent method.
_appticsFlutterPlugin.addEvent("eventName", "eventGroupName", {'propKey': 'propValue'})

Screen Tracking

Use the methods provided to track screen navigation.


// call when screen appears
_appticsFlutterPlugin.screenAttached("screenName")

// call when screen disappears
_appticsFlutterPlugin.screenDetached("screenName")

Track User

Ties user-id with other stats (events, screens etc)

User Id tracking will happen with respect to Tracking Settings. If the tracking settings is " WithoutPII", stats will not be associated with the user id.


_appticsFlutterPlugin.setUser("userid")

Tracking settings

Apptics offer 7 tracking states to control usage and crash tracking.

  1. UsageAndCrashTrackingWithPII
  2. UsageAndCrashTrackingWithoutPII
  3. OnlyUsageTrackingWithPII
  4. OnlyUsageTrackingWithoutPII
  5. OnlyCrashTrackingWithPII
  6. OnlyCrashTrackingWithoutPII
  7. NoTracking

UsageAndCrashTrackingWithoutPII is the default state out of the box.

Usage Tracking

Usage tracking generally refers to tracking the Events, APIs, Screens, Sessions.

Crash Tracking

Crash tracking is self-explanatory and refers to the tracking of unhandled exceptions.

PII

The term PII is used to denote the value you set using the _appticsFlutterPlugin.setUser method.

You can use setTrackingState method to change the tracking state.


// to change the tracking settings to track only crash and associate user id with crash.
_appticsFlutterPlugin.setTrackingState(TrackingState.OnlyCrashTrackingWithPII);

// to get the current tracking state
_appticsFlutterPlugin.getTrackingState();
5
likes
0
pub points
55%
popularity

Publisher

verified publisherzoho.com

Flutter plugin for Zoho Apptics SDK.

Homepage

License

unknown (LICENSE)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on apptics_flutter