reteno_plugin 1.0.0 copy "reteno_plugin: ^1.0.0" to clipboard
reteno_plugin: ^1.0.0 copied to clipboard

outdated

The Reteno Flutter Plugin for Mobile Customer Engagement and Analytics solutions

reteno_plugin #

Reteno Flutter SDK

Documentation #

Official documentation

Installation #

iOS #

Installation

  1. Run next command from root of your project:
flutter pub add reteno_plugin 
  1. Add mavenCentral repository in your project level build.gradle:
buildscript { 
    repositories { 
        mavenCentral() 
    } 
... 
}
  1. Also you may need to increase minSdkVersion in project level build.gradle to 26, since Reteno uses this version as minimal;

Setting up SDK

  1. Follow Step 1 described in Android SDK setup guide: link;

  2. Follow Step 2 described in Android SDK setup guide: link;

  3. Edit your MainApplication class and provider API Access-Key at SDK initialization.

Below is sample code you can add to your application class which gets you started with RetenoSDK.

package [com.YOUR_PACKAGE];

import com.reteno.core.Reteno
import com.reteno.core.RetenoApplication
import com.reteno.core.RetenoImpl
import io.flutter.app.FlutterApplication

class CustomApplication : FlutterApplication(), RetenoApplication {
    override fun onCreate() {
        super.onCreate()
        retenoInstance = RetenoImpl(this, "630A66AF-C1D3-4F2A-ACC1-0D51C38D2B05")
    }

    private lateinit var retenoInstance: Reteno
    override fun getRetenoInstance(): Reteno {
        return retenoInstance
    }
}

  1. Follow Step 5 described in Android SDK setup guide: link;

Android #

Installation

  1. Run next command from root of your project:
flutter pub add reteno_plugin 
  1. Add mavenCentral repository in your project level build.gradle:
buildscript { 
    repositories { 
        mavenCentral() 
    } 
... 
}
  1. Also you may need to increase minSdkVersion in project level build.gradle to 26, since Reteno uses this version as minimal;

Setting up SDK

  1. Follow Step 1 described in Android SDK setup guide: link;

  2. Follow Step 2 described in Android SDK setup guide: link;

  3. Edit your MainApplication class and provider API Access-Key at SDK initialization.

Below is sample code you can add to your application class which gets you started with RetenoSDK.

package [com.YOUR_PACKAGE];

import com.reteno.core.Reteno
import com.reteno.core.RetenoApplication
import com.reteno.core.RetenoImpl
import io.flutter.app.FlutterApplication

class CustomApplication : FlutterApplication(), RetenoApplication {
    override fun onCreate() {
        super.onCreate()
        retenoInstance = RetenoImpl(this, "630A66AF-C1D3-4F2A-ACC1-0D51C38D2B05")
    }

    private lateinit var retenoInstance: Reteno
    override fun getRetenoInstance(): Reteno {
        return retenoInstance
    }
}

  1. Follow Step 5 described in Android SDK setup guide: link;

Push notifications #

Getting initial notification #

When you instantiate the app by clicking on a push notification, you may need to get its payload. To do it, use the getInitialNotification method:

import 'package:reteno_plugin/reteno.dart';

final Reteno reteno = Reteno();

reteno.getInitialNotification().then((Map<String, dynamic>? payload) {
      // Process payload...
});

Listening for new push notifications in an open app #

When the app is open, you may need to track for new push notifications. For that, the plugin provides the onRetenoNotificationReceived stream you can listen to:

import 'package:reteno_plugin/reteno.dart';

Reteno.onRetenoNotificationReceived.listen((Map<String, dynamic> payload) {
      // Process payload...
});

Tracking user information #

You can track the user related information using external user ID and/or user attributes. For that, you have to add userExternalId and setUserAttributes to Reteno Flutter.

Adding External User ID #

External user ID is an ID you have assigned to a user in your system (external for 'Reteno'). You can add these in Reteno Flutter using the following method:

import 'package:reteno_plugin/reteno.dart';

final reteno = Reteno();
reteno.setUserAttributes(
  userExternalId: 'USER_ID',
  user: userInfo,
);

Adding User Attributes #

User attributes define the information you collect about contacts in your user base. For example, phone number, email address, language preference, geographic location.

You can add user attributes using the following method:

import 'package:reteno_plugin/reteno.dart';

final reteno = Reteno();
reteno.setUserAttributes(
  userExternalId: 'USER_ID',
  user: userInfo,
);

Structure of the RetenoUser object:

class RetenoUser {
  RetenoUser({
    this.subscriptionKeys,
    this.userAttributes,
    this.groupNamesExclude,
    this.groupNamesInclude,
  });

  final UserAttributes? userAttributes;
  final List<String>? subscriptionKeys;
  final List<String>? groupNamesInclude;
  final List<String>? groupNamesExclude;
}

class UserAttributes {
  UserAttributes({
    this.lastName,
    this.firstName,
    this.address,
    this.email,
    this.fields,
    this.languageCode,
    this.phone,
    this.timeZone,
  });
  final String? phone;
  final String? email;
  final String? firstName;
  final String? lastName;
  final String? languageCode;
  final String? timeZone;
  final Address? address;
  final List<UserCustomField>? fields;
}

class Address {
  Address({
    this.address,
    this.postcode,
    this.region,
    this.town,
  });
  final String? region;
  final String? town;
  final String? address;
  final String? postcode;
}

class UserCustomField {
  UserCustomField({
    required this.key,
    this.value,
  });
  final String key;
  final String? value;
}

Note

LanguageCode

The tags for identifying language must be in compliance with RFC 5646. The primary language subtag must comply with the ISO 639-1 format. Example: de-AT.

TimeZone

The time zone format must comply with TZ database. Example: Europe/Kyiv.

License #

MIT

2
likes
0
points
1.32k
downloads

Publisher

unverified uploader

Weekly Downloads

The Reteno Flutter Plugin for Mobile Customer Engagement and Analytics solutions

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on reteno_plugin

Packages that implement reteno_plugin