Appdynamics / appdynamics_flutter_agent

Flutter plugin to integrate AppDynamics Mobile Real User Monitoring with your app.
Other
5 stars 9 forks source link

Pub Version

AppDynamics Flutter Plugin

Extension of the AppDynamics SDK that allows you to instrument Flutter apps and receive analytics.

This plugin wraps the native SDKs and requires a valid AppDynamics mobile license.

Features

The Flutter agent incorporates the following features:

Getting started

Installation

You can install the Flutter plugin via flutter — more info on the Installation tab.

$ flutter pub add appdynamics_agent

Extra configuration for Android apps:

  1. Add the following changes to android/build.gradle:
dependencies {
    classpath "com.appdynamics:appdynamics-gradle-plugin:22.2.2"
    // ... other dependencies
}
  1. Apply the adeum plugin to the bottom of the android/app/build.gradle file:
dependencies {
    // ... project dependencies
}

// Bottom of file
apply plugin: 'adeum'
  1. Add the following permissions to your AndroidManifest.xml (usually in android/src/main/):
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myawesomepackage">

    <!-- add these two permissions -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <!-- other permissions -->

    <application>
        <!-- other settings -->
    </application>
</manifest>

Start instrumentation

NOTE: Replace <EUM_APP_KEY> with your app key.

import 'package:appdynamics_agent/appdynamics_agent.dart';
import 'package:flutter/material.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  final config = AgentConfiguration(
      appKey: "<EUM_APP_KEY>",
      loggingLevel: LoggingLevel.verbose, // optional, for better debugging.
      collectorURL: "<COLLECTOR_URL>", // optional, mostly on-premises. 
      screenshotURL: "<SCREENSHOT_URL>" // optional, mostly on-premises.
  );
  await Instrumentation.start(config);

  runApp(const MyApp());
}

Docs

You can access pub.dev docs or check the official docs for extra customization of the agent.