rudder_sdk_flutter 1.0.1-beta1 copy "rudder_sdk_flutter: ^1.0.1-beta1" to clipboard
rudder_sdk_flutter: ^1.0.1-beta1 copied to clipboard

outdated

The RudderStack Flutter SDK allows you to track event data from your app. It can be easily integrated into your Flutter application. After integrating this SDK, you will also send the event data to yo [...]

What is Rudder? #

Short answer: Rudder is an open-source Segment alternative written in Go, built for the enterprise.

Long answer: Rudder is a platform for collecting, storing and routing customer event data to dozens of tools. Rudder is open-source, can run in your cloud environment (AWS, GCP, Azure or even your data-centre) and provides a powerful transformation framework to process your event data on the fly.

Released under MIT License

Getting Started with Flutter SDK #

  • Add the SDK as a dependency by performing the following steps:
  1. Open pubspec.yaml and add rudder_sdk_flutter under dependencies section:
dependencies:
  rudder_sdk_flutter: ^1.0.0
  1. Navigate to your Application's root folder and install all the required dependencies with:
flutter pub get

Import RudderClient #

Add the below line to import the RudderClient.

import 'package:rudder_sdk_flutter/RudderClient.dart';

Initialize RudderClient #

Somewhere in your Application, add the following code

    RudderConfigBuilder builder = RudderConfigBuilder();
    builder.withDataPlaneUrl(DATA_PLANE_URL);
    builder.withTrackLifecycleEvents(true);
    builder.withRecordScreenViews(true);
    RudderClient.getInstance(WRITE_KEY,config: builder.build());

Send Events #

An example track call is as below

    RudderProperty property = RudderProperty();
    property.put("test_key_1", "test_key_1");
    RudderClient.track("test_track_event", properties: property);

Device Tokens #

You can pass your device-token for Push Notifications to be passed to the destinations which support Push Notification. We set the token under context.device.token. An example of setting the device-token is as below

   RudderClient.putDeviceToken(<DEVICE_TOKEN>);

Anonymous ID #

We use the deviceId as anonymousId by default. You can use the following method to override and use your own anonymousId with the SDK. You need to call setAnonymousId method before calling getInstance. An example of setting the anonymousId is as below

   RudderClient.setAnonymousId(<ANONYMOUS_ID>);

Advertising ID #

You can use the setAdvertisingId method to pass your Android and iOS AAID and IDFA respectively. The setAdvertisingId method accepts a string argument :

  • advertisingId : Your Android advertisingId (AAID) (or) Your iOS advertisingId (IDFA) On Android device you need to call setAdvertisingId method before calling getInstance Example Usage:
   RudderClient.setAdvertisingId(<ADVERTISING_ID>);

The advertisingId parameter you pass to the above method is assigned as AAID if you are on android device and as IDFA if you are on a iOS device. For more detailed documentation check the documentation page.

Contact Us #

If you come across any issues while configuring or using RudderStack, please feel free to contact us or start a conversation on our Slack channel. We will be happy to help you.

14
likes
0
points
24.4k
downloads

Publisher

verified publisherrudderstack.com

Weekly Downloads

The RudderStack Flutter SDK allows you to track event data from your app. It can be easily integrated into your Flutter application. After integrating this SDK, you will also send the event data to your preferred analytics destination/s, such as Google Analytics, Amplitude, and more.

Repository (GitHub)
View/report issues

Documentation

Documentation

License

unknown (license)

Dependencies

flutter, intl, logger

More

Packages that depend on rudder_sdk_flutter