Giter Club home page Giter Club logo

flutter-segment's Introduction

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

⚠️ ⚠️ We are no longer mantaining this library. Feel free to fork it and work on your own branch. ⚠️ ⚠️

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Segment plugin

Pub Version style: lint

This library was created by our friends at claimsforce-gmbh to whom we are deeply grateful for letting us contribute. From now this project will be maintained from this repository.

Flutter plugin to support iOS, Android and Web sources at https://segment.com.

Future development

We want to prepare flutter-segment for the future! Please have a look at this issue and let us know what you think.

Usage

To use this plugin, add flutter_segment as a dependency in your pubspec.yaml file.

Important note for iOS usage

Since version 3.5.0 we are forcing all users to use use_frameworks! within the Podfile due to import issues of some 3rd party dependencies.

Supported methods

Method Android iOS Web MacOS Windows Linux
identify X X X
track X X X
screen X X X
group X X X
alias X X X
getAnonymousId X X X
reset X X X
disable X X
enable X X
flush X X
debug X* X X
setContext X X

* Debugging must be set as a configuration parameter in AndroidManifest.xml (see below). The official segment library does not offer the debug method for Android.

Example

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    Segment.screen(
      screenName: 'Example Screen',
    );
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Segment example app'),
        ),
        body: Center(
          child: FlatButton(
            child: Text('TRACK ACTION WITH SEGMENT'),
            onPressed: () {
              Segment.track(
                eventName: 'ButtonClicked',
                properties: {
                  'foo': 'bar',
                  'number': 1337,
                  'clicked': true,
                },
              );
            },
          ),
        ),
      ),
      navigatorObservers: [
        SegmentObserver(),
      ],
    );
  }
}

Migration from v2.x to v3.x

In v3.x we removed branch io integration as the package is in the the maintenance mode and uses outdated dependencies. If you don't use ENABLE_BRANCH_IO_INTEGRATION you are good to go. If you want to continue using ENABLE_BRANCH_IO_INTEGRATION then use v2.x of this package.

Installation

Setup your Android, iOS and/or web sources as described at Segment.com and generate your write keys.

Set your Segment write key and change the automatic event tracking (only for Android and iOS) on if you wish the library to take care of it for you. Remember that the application lifecycle events won't have any special context set for you by the time it is initialized.

Via Dart Code

void main() {
  /// Wait until the platform channel is properly initialized so we can call
  /// `setContext` during the app initialization.
  WidgetsFlutterBinding.ensureInitialized();
  
  String writeKey;
  if(Platform.isAndroid){
    writeKey = "ANDROID_WRITE_KEY";
  } else{ //iOS
      writeKey = "IOS_WRITE_KEY";
  }

  Segment.config(
    options: SegmentConfig(
      writeKey: 'YOUR_WRITE_KEY_GOES_HERE',
      trackApplicationLifecycleEvents: false,
      amplitudeIntegrationEnabled: false,
      debug: false,
    ),
  );
}

Android (Deprecated*)

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.flutter_segment_example">
    <application>
        <activity>
            [...]
        </activity>
        <meta-data android:name="com.claimsforce.segment.WRITE_KEY" android:value="YOUR_WRITE_KEY_GOES_HERE" />
        <meta-data android:name="com.claimsforce.segment.TRACK_APPLICATION_LIFECYCLE_EVENTS" android:value="false" />
        <meta-data android:name="com.claimsforce.segment.ENABLE_AMPLITUDE_INTEGRATION" android:value="false" />
        <meta-data android:name="com.claimsforce.segment.DEBUG" android:value="false" />
    </application>
</manifest>

iOS (Deprecated*)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  [...]
  <key>com.claimsforce.segment.WRITE_KEY</key>
  <string>YOUR_WRITE_KEY_GOES_HERE</string>
  <key>com.claimsforce.segment.TRACK_APPLICATION_LIFECYCLE_EVENTS</key>
  <false/>
  <key>com.claimsforce.segment.ENABLE_AMPLITUDE_INTEGRATION</key>
  <false/>
  [...]
</dict>
</plist>

Web

<!DOCTYPE html>
<html>
<head>
  [...]
</head>
<body>
<script>
  !function(){ ...;
    analytics.load("YOUR_WRITE_KEY_GOES_HERE");
    analytics.page();
  }}();
</script>
  <script src="main.dart.js" type="application/javascript"></script>
</body>
</html>

For more informations please check: https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/quickstart/

Sending device tokens strings for push notifications

Segment integrates with 3rd parties that allow sending push notifications. In order to do that you will need to provide it with the device token string - which can be obtained using one of the several Flutter libraries.

As soon as you obtain the device token string, you need to add it to Segment's context by calling setContext and then emit a tracking event named Application Opened or Application Installed. The tracking event is needed because it is the only moment when Segment propagates it to 3rd parties.

Both calls (setContext and track) can be done sequentially at startup time, given that the token exists. Nonetheless, if you don't want to delay the token propagation and don't mind having an extra Application Opened event in the middle of your app's events, it can be done right away when the token is acquired.

await Segment.setContext({
  'device': {
    'token': yourTokenString
  },
});

// the token is only propagated when one of two events are called:
// - Application Installed
// - Application Opened
await Segment.track(eventName: 'Application Opened');

A few important points:

  • The token is propagated as-is to Segment through the context field, without any manipulation or intermediate calls to Segment's libraries. Strucutred data - such as APNs - need to be properly converted to its string representation beforehand
  • On iOS, once the device.token is set, calling setContext({}) will not clean up its value. This occurs due to the existence of another method from segment's library that sets the device token for Apple Push Notification service (APNs )
  • setContext always overrides any previous values that were set in a previous call to setContext
  • setContext is not persisted after the application is closed

Setting integration options

If you intend to use any specific integrations with third parties, such as custom Session IDs for Amplitude, you'll need to set it using options for each call, or globally when the application was started.

Setting the options in every call

The methods below support options as parameters:

  • identify({@required userId, Map<String, dynamic> traits, Map<String, dynamic> options})
  • track({@required String eventName, Map<String, dynamic> properties, Map<String, dynamic> options})
  • screen({@required String screenName, Map<String, dynamic> properties, Map<String, dynamic> options})
  • group({@required String groupId, Map<String, dynamic> traits, Map<String, dynamic> options})
  • alias({@required String alias, Map<String, dynamic> options})

An example of a screen being tracked as part of a session, which will be communicated to Amplitude:

Segment.screen(
  screenName: screenName,
  properties: {},
  options: {
    'integrations': {
      'Amplitude': {'session_id': '1578083527'}
    }
  },
)

Setting the options globally

You can also set the default options to be used in every method call, if the call omits the options parameter. Just set SegmentDefaultOptions.instance.options. For example:

SegmentDefaultOptions.instance.options = {
  'integrations': {
    'Amplitude': {
      'session_id': '1578083527'
    }
  }
}

Issues

Please file any issues, bugs, or feature requests in the GitHub repo.

Contributing

If you wish to contribute a change to this repo, please send a pull request.

*This installation method will be removed, please use the Installation via Dart Code instructions.

flutter-segment's People

Contributors

ariefwijaya avatar b099l3 avatar bmelnychuk avatar btrautmann avatar cdmunoz avatar danielgomezrico avatar esarbanis avatar fweinaug avatar gertdrui avatar iaasthatech avatar jjchiw avatar johnsouza-loftbr avatar kev52 avatar maikay avatar manuelbulos avatar minoesteban avatar shashikantdurge avatar shashikantleher avatar t-moz avatar tzvc avatar vbuberen avatar vinicius-animo avatar zenled avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flutter-segment's Issues

Request: Flutter desktop support (MacOS and Windows)

We would like to try segment at Superlist. I've noticed that the current version is based on dart so I thought it could work. however, the track event does throw:
MissingPluginException(No implementation found for method track on channel flutter_segment)

Any plans of having those platforms supported?

MissingPluginException(No implementation found for method config on channel flutter_segment)

Hello, we recently updated to 3.12.1 version and also improved our error catching with the latest Firebase Crashlytics SDK version.

We are now seeing the following error happening in production according to Crashlytics, but only for iOS devices:

MethodChannel._invokeMethod
FlutterError - MissingPluginException(No implementation found for method config on channel flutter_segment)
0  ???                            0x0 MethodChannel._invokeMethod + 308 (platform_channel.dart:308)
1  ???                            0x0 SegmentMethodChannel.config + 15 (segment_method_channel.dart:15)

We were not able to reproduce it locally yet, but seems like an issue in the config call for iOS native SDK.
We are unsure how this is affecting our segment events, from our analysis the iOS events seems to be flowing through without issues, so might not be a big deal.

We haven't updated to the latest version 3.13.0 because of a conflict with the Flutter Appsflyer SDK, but if it fixes this we can take a look into updating it as soon as possible.

support gradle 8.0.0

getting error missing namespace when upgrading to flutter 3.10 with gradle 8.0

Can't build app on iOS after upgrading to 3.9.0

After upgrading to 3.9.0, I keep getting an error when Xcode tries to build the app on iOS.

Uncategorized (Xcode): Command CompileSwiftSources failed with a nonzero exit
code


Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside
framework module 'segment_appsflyer_ios.SEGAppsFlyerIntegration':
'/Users/bhayatus/mednow/suite/services/suite-mobile-customer/src/ios/Pods/Hea
ders/Public/Analytics/SEGAnalytics.h'
/Users/bhayatus/mednow/suite/services/suite-mobile-customer/src/ios/Pods/segm
ent-appsflyer-ios/segment-appsflyer-ios/Classes/SEGAppsFlyerIntegration.h:11:8


Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside
framework module 'segment_appsflyer_ios.SEGAppsFlyerIntegration':
'/Users/bhayatus/mednow/suite/services/suite-mobile-customer/src/ios/Pods/Hea
ders/Public/Analytics/SEGAnalyticsUtils.h'
/Users/bhayatus/mednow/suite/services/suite-mobile-customer/src/ios/Pods/segm
ent-appsflyer-ios/segment-appsflyer-ios/Classes/SEGAppsFlyerIntegration.h:12:8


Lexical or Preprocessor Issue (Xcode): Include of non-modular header inside
framework module 'segment_appsflyer_ios.SEGAppsFlyerIntegrationFactory':
'/Users/bhayatus/mednow/suite/services/suite-mobile-customer/src/ios/Pods/Hea
ders/Public/Analytics/SEGIntegrationFactory.h'
/Users/bhayatus/mednow/suite/services/suite-mobile-customer/src/ios/Pods/segm
ent-appsflyer-ios/segment-appsflyer-ios/Classes/SEGAppsFlyerIntegrationFactory.h
:10:8


Parse Issue (Xcode): Could not build module 'segment_appsflyer_ios'
/Users/bhayatus/development/flutter/.pub-cache/hosted/pub.dartlang.org/flutte
r_segment-3.9.0/ios/Classes/FlutterSegmentPlugin.m:0:8

Amplitude session id always -1

I've not been able to get session ids working for Amplitude on both iOS and Android. Session IDs keep defaulting to -1. This is with amplitudeIntegrationEnabled enabled and for both per event and system default method:

# The per event method
Segment.screen(
  screenName: screenName,
  properties: {},
  options: {
    'integrations': {
      'Amplitude': {'session_id': '1578083527'}
    }
  },
)

# System default method
SegmentDefaultOptions.instance.options = {
  'integrations': {
    'Amplitude': {
      'session_id': '1578083527'
    }
  }
}

I've tried passing in the example value 1578083527 as session id, as well as a second and a millisecond unix epoch, none seem to propagate to Amplitude.

Anything I am missing or a configuration step I'm overlooking? Thank you for your help!

Algolia Events triggered from Segment but not shown in algolia dashboard

I have used the algolia_helper_flutter: ^0.3.1 as the zip and integrated directly to the project, because the plugin is not merged properly so we don't have the click anayltics param.After integrating it directly i can trigger the event of segment using algolia params also.

Segment.track(eventName: 'test', options: {
'product_id': '507f1f77bcf86cd799439011',
'sku': 'G-32',
'category': 'Games',
'name': 'Monopoly: 3rd Edition',
'brand': 'Hasbro',
'variant': '200 pieces',
'price': 18.99,
'quantity': 1,
'coupon': 'MAYDEALS',
'position': 3,
'url': 'https://www.example.com/product/path',
'image_url': 'https://www.example.com/product/path.jpg',

//algolia params
'index': 'my-algolia-index',
'eventType': 'click',
'queryID': _shoeSearcher.responses,
'objectID': '131280270'
});

Algolia Events triggered from Segment but not shown in algolia dashboard

I have used the algolia_helper_flutter: ^0.3.1 as the zip and integrated directly to the project, because the plugin is not merged properly so we don't have the click anayltics param.After integrating it directly i can trigger the event of segment using algolia params also.

Segment.track(eventName: 'test', options: {
'product_id': '507f1f77bcf86cd799439011',
'sku': 'G-32',
'category': 'Games',
'name': 'Monopoly: 3rd Edition',
'brand': 'Hasbro',
'variant': '200 pieces',
'price': 18.99,
'quantity': 1,
'coupon': 'MAYDEALS',
'position': 3,
'url': 'https://www.example.com/product/path',
'image_url': 'https://www.example.com/product/path.jpg',

//algolia params
'index': 'my-algolia-index',
'eventType': 'click',
'queryID': _shoeSearcher.responses,
'objectID': '131280270'
});

In segment the event delivered successfully, but i cannot see any trace in the algolia dashboard.
Screenshot 2023-05-26 at 1 51 12 PM
Screenshot 2023-05-24 at 6 41 49 PM

Am expecting to visible the event in algolia.

advertising_id not being picked up in segment context

Context
I am trying to send app events from an Android app developed in Flutter to Facebook by using the flutter-segment library.

Config
I have checked that I use Advertising ID on the Play Console in the App Content section
I have added <uses-permission android:name="com.google.android.gms.permission.AD_ID"/> to the manifest

Issue
When running my app locally with Android Studio Emulator in debug mode with "flutter run", advertising_id is surfaced correctly in the segment context object. However when running the app locally in the same conditions but in release mode with "flutter run --release" (or deploying the app to the Play Store), advertising_id is missing from the context.

Am I missing anything?

How to use WebEngage through flutter_segment.

I want to integrate WebEngage through flutter, can you please guide me how to do so.

For instance, native integration looks like:

Analytics analytics = new Analytics.Builder(this, "KEY") .trackApplicationLifecycleEvents() // Enable this to record certain application events automatically! .logLevel(Analytics.LogLevel.VERBOSE) .use(WebEngageIntegration.FACTORY.withWebEngageConfig(webEngageConfig)) .build();

Request: Ad Tracking and IDFA Docs?

I see this package is using analytics-ios 4.1.6

When trying to set up Ad Tracking and IDFA I noticed the official docs has some setup steps with analytics-ios 4.1 or greater:

Starting iOS 14, applications must prompt users if that app needs to collect their Identifier for Advertisers (IDFA). Going forward with analytics-ios-4.1 and later, Segment doesn’t auto-collect IDFA. If your app or any integrations require the use of IDFA, you need to:

  1. import the AdSupport and App Tracking Transparency Frameworks by Apple
  2. pass the below code snippet to Segment config and start tracking events
  3. prompt the user for consent and collect the IDFA
    You can use the following closure snippet to pass the value to analytics-ios as configurations:
@import AdSupport;

...

SEGAnalyticsConfiguration* configuration = [SEGAnalyticsConfiguration configurationWithWriteKey:@"YOUR_WRITE_KEY"];
// Enable advertising collection
configuration.enableAdvertisingTracking = YES;
// Set the block to be called when the advertisingID is needed
// NOTE: In iOS 14, you'll need to manually do authorization elsewhere and only when it has been authorized, return the advertisingIdentifier to segment via the block below
configuration.adSupportBlock = ^{
    return [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
};
[SEGAnalytics setupWithConfiguration:configuration];

Or the option of setting two keys under the context object:

Ad-tracking affects two keys under the context object of every event:

device.adTrackingEnabled true if SDK is setup with closure and user has consented, false otherwise
device.advertisingId idfa_value if user opts-in otherwise this key is skipped from event payload

I did this using the second option of adding to the context object, with the IDFA which I got from using this package:

final advertisingId = await getAdvertisingId();
final adTrackingEnabled = await getadTrackingEnabled();

Segment.setContext({
  'device': {
    'adTrackingEnabled': adTrackingEnabled.toString(),
    'advertisingId': advertisingId,
  }
});

I wonder if we should add some docs for setting up Ad Tracking and IDFA on iOS? I can do it just want to make sure this is something we want on this repo?

App installed event tracking problem for iOS

I have noticed a problem with app installed event not being tracked for iOS. I am using version 3.7.0. In the Segment configuration Segment.config I have trackApplicationLifecycleEvents set: true, but this event does not seem to work.

Gitignore / Pubignore inconsistencies: some files exists on gitignore but are commited into the repository

After running flutter pub publish it prints this warning:

* 7 checked-in files are ignored by a `.gitignore`.
  Previous versions of Pub would include those in the published package.

  Consider adjusting your `.gitignore` files to not ignore those files, and if you do not wish to
  publish these files use `.pubignore`. See also dart.dev/go/pubignore

  Files that are checked in while gitignored:

  android/gradle/wrapper/gradle-wrapper.jar
  android/gradlew
  android/gradlew.bat
  example/android/app/src/debug/AndroidManifest.xml
  example/ios/Podfile.lock
  example/pubspec.lock
  pubspec.lock

Appsflyer integration is not sending

Having configured the integration with appsflyer, it usually happens that events are sent with: integrations: {}, is there any reason for this to happen?

Use pubspec version on each platform Library version

Current

We need to go to these files manually and put the same value from pubspec.yml (https://github.com/la-haus/flutter-segment/blob/master/pubspec.yaml#L3) in here on each release

Each file where it should be updated:

Expected

We just have to update pubspec.yml version and each platform will use that version somehow without a manual update

Google Play policy violation caused by targeting Android 11 (API level 31)

Issue description

On August 11th, our Flutter app received a warning "App must target Android 13 (API level 33) or higher" from Google Play. Because of the violation, our app won't be able to upload updates to Google Play: "From Nov 1, 2023, if your target API level is not within 1 year of the latest Android release, you won't be able to update your app.".

Our app targets Android API level 33, but this library targets API level 31.

Please update the library Android target to API level 33 so the library users wouldn't receive this Google Play warning.

Flutter doctor summary

[!] Flutter (Channel stable, 3.10.6, on macOS 13.4 22F66 darwin-arm64 (Rosetta),
locale en-LT)
! Warning: dart on your path resolves to
/opt/homebrew/Cellar/dart/2.19.5/libexec/bin/dart, which is not inside
your current Flutter SDK checkout at /Users/sarunas/fvm/versions/3.10.6.
Consider adding /Users/sarunas/fvm/versions/3.10.6/bin to the front of
your path.
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.77.1)
[✓] Connected device (2 available)
[✓] Network resources

App build.gradle

    minSdkVersion 23
    targetSdkVersion 33

Flutter lib version used

flutter_segment: 3.13.0

Compile version 31 here: https://github.com/la-haus/flutter-segment/blob/master/android/build.gradle

Don't import implementation files from another package error

Flutter analyze seems to fail with this error:

info • Don't import implementation files from another package • lib/generated_plugin_registrant.dart:17:8 • implementation_imports

import 'package:flutter_segment/src/segment_web.dart' 

SegmentWeb.registerWith(registrar);

[DISCUSSION][Tech Debt] - Fully Dynamic and Scalable Segment Integration

Hello, @danielgomezrico @pastuxso
just brainstorming, why don't we use this Integration Attribute as an array of enumeration or object list? It will be more clean, scalable and avoid breaking changes. I mean like, instead of using amplitudeIntegrationEnabled, mixpanelIntegrationEnabled. We can try using integrationList : [IntegrationType.mixpanel, IntegrationType.amplitude] or even use an object list integrationList : [AmplitudeIntegrationClass(enabled:true,param1:"value",param2:"value"),...]

wdyt all?

Request: Facebook App Events Support

Context

I am looking to use Facebook App Events, only the Application Installed event, to track ads -> installs.

Current state of play

There is only a native and react-native support for this and Flutter we will have to add in to this repo or fork.

From reading these issues on this repo, I assume there is going to be work towards a "Fully Dynamic and Scalable Segment Integration":

In the meantime it looks like all integrations are done in this repo, with the idea of eventually separating them out:

PRs with integrations:

As for the Application Installed event, it appears there is an issue where it doesn't fire via the dart implementation:

  • #26
    I have noticed no Application Installed but I do get Application Opened Application Backgrounded events. So I will try to look into that.

Solutions

what is the best way to take this forward?

  1. Fork this repo and add in my dependancy via the same method as the PRs with integrations above. To avoid adding more PRs to this repo before its changed to "Fully Dynamic and Scalable Segment Integration"
  2. Fork and merge my addition of Facebook App Events
  3. Try to mix together this package and facebook_app_events as mentioned here #26 (comment) Does @ariefwijaya have an example of this?

Confusing Documentation needs to be improved

The package's readme file says something about deprecation in AndroidManifest and Info.plist files.
However, it is not clear if the deprecated part is needed in latest versions (for eg: 3.9.0).

Also, looking at the latest example code, it is still using deprecated code.

Can you guys please update the documentation or the example?

Screen Shot 2022-07-01 at 17 36 09

Code Style: setup

We need to setup each platform so every PR does not include style changes:

  • Flutter dart code
  • Android kotlin code
  • iOS swift code

PlatformException(FlutterSegmentException) is thrown on Segment.track

PlatformException(FlutterSegmentException, +[SEGAnalytics sharedAnalytics]: unrecognized selector sent to class 0x11197fd30, (
0 Runner 0x000000010c2f57c3 -[FlutterSegmentPlugin track:result:] + 519
1 Runner 0x000000010c2f4ce2 -[FlutterSegmentPlugin handleMethodCall:result:] + 513
2 Flutter 0x00000001177e6f81 __45-[FlutterMethodChannel setMethodCallHandler:]_block_invoke + 104
3 Flutter 0x0000000117225ef2 ___ZN7flutter25PlatformMessageHandlerIos21HandlePlatformMessageENSt3__110unique_ptrINS_15PlatformMessageENS1_14default_deleteIS3_EEEE_block_invoke + 86
4 libdispatch.dylib 0x00007ff80013b7fb _dispatch_call_block_and_release + 12
5 libdispatch.dylib 0x00007ff80013ca3a _dispatch_client_callout + 8
6 libdispatch.dylib 0x00007ff80014c32c _dispatch_main_queue_drain + 1338
7 libdispatch.dylib <…>

receivedRemoteNotification

Hi,
I see that in iOS there is a way to report that a push was recieved:
Analytics.shared().receivedRemoteNotification. Is there a way to do the same in Flutter?

How to configure AppsFlyer on Segment?

I saw that we have a SegmentConfig called appsflyerIntegrationEnabled, but I could not see where to add AppsFlyer specific params, like devKey.

So, what does this field appsflyerIntegrationEnabled=true do?

ps: I try to read the native codes, but I am not versed on the native platforms, and I did not find any reference for this field on the docs.

Google Play policies non-compliance issue for using android segment analytics version below 4.10.1

We are using the flutter_segment v3.13.1 in our app and while updating the app it got rejected saying that the segment version we are using does not comply with Google's privacy policy:

We found an issue in the following area(s):
SDK: Segment com.segment.analytics.android:analytics (consider upgrading to version 4.10.1)

Additionally, follow these steps to bring your app into compliance:

You may consider upgrading to a policy-compliant version of this SDK, if available from your SDK provider or removing the SDK.
According to the information provided by your SDK provider, you may consider upgrading to version 4.10.1. Google is not endorsing or recommending any third-party software. Please consult the SDK provider for further information.

I check the segments.analytics version in build.gradle file and it's already v 4.10.4:
implementation 'com.segment.analytics.android:analytics:4.10.4'
Link of the file: https://github.com/la-haus/flutter-segment/blob/master/android/build.gradle

But I'm still getting this non-compliance issue and can't update my app. Any help?

The root value is missing the required field 'device_id'

i am sending the data from segment to customer.io, here i am facing one issue which is this 👇
The root value is missing the required field 'device_id'
i am passing the device_id everywhere both events and Identify call, but still getting the same error
the code snippet is :
this is for Identify call
Screenshot 2023-08-16 at 6 08 53 PM
this is for event call:
Screenshot 2023-08-16 at 6 09 54 PM.
here i am getting deviceId from device_info_plus package
Screenshot 2023-08-16 at 6 13 39 PM

can you help me to fix this

Update AppsFlyer SDK

We are using flutter-segment here and we also added appsflyer_sdk package on the project to directly handle some appsFlyer events. Now we are getting conflicts on Native Appsflyer SDK versions.

I would suggest upgrade the AppsFlyer SDK version here on flutter-segment package.

[!] CocoaPods could not find compatible versions for pod "AppsFlyerFramework":
  In Podfile:
    appsflyer_sdk (from `.symlinks/plugins/appsflyer_sdk/ios`) was resolved to 6.8.0, which depends on
      AppsFlyerFramework (= 6.9.1)

    flutter_segment (from `.symlinks/plugins/flutter_segment/ios`) was resolved to 3.12.1, which depends on
      segment-appsflyer-ios (= 6.8.0) was resolved to 6.8.0, which depends on
        segment-appsflyer-ios/Main (= 6.8.0) was resolved to 6.8.0, which depends on
          AppsFlyerFramework (~> 6.8.0)

Google non-compliance issue for using android segment version below 4.10.1

We are using the flutter_segment plugin in our app, version 3.12.1. Recently, we received an email that the segment version we are using does not comply with Google's privacy policy. Here is a brief from the email,
"You may consider upgrading to a policy-compliant version of this SDK, if available from your SDK provider or removing the SDK. According to the information provided by your SDK provider, you may consider upgrading to version 4.10.1. Google is not endorsing or recommending any third-party software. Please consult the SDK provider for further information."

From the change log, the Android Segment SDK version used in this library is 4.10.0.

We have only two weeks left to resubmit the app with the policy-compliant version. Therefore, if we can get the latest version of the flutter_segment library with the latest Android Segment SDK version 4.10.4 that would be much appreciated.

Non compliant SDK version android.analytics error

Hello there. Tried uploading a new app version to Google play store and received this error:

"Your app xxx.xx.xxx.xx version code 1 includes SDK com.segment.analytics.android:analytics, 4.10.0 or an SDK that one of your libraries depends on which collects personal or sensitive data that includes but may not be limited to Advertising ID, Android ID identifiers. Persistent device identifiers may not be linked to other personal and sensitive user data or resettable device identifiers as described in the user data policy.

Starting from 9 August 2022 midnight (UTC), new app releases containing SDK versions that do not comply with the User data policy will be blocked from release ......According to the information provided by your SDK provider, you may consider upgrading to 4.10.1. Please consult the SDK provider for further information"

I have the latest version flutter_segment: 3.7.0. The screenshot shows the build.gradle file inside flutter_segment: 3.7.0.

Please help! URGENT

Screenshot 2022-06-13 at 15 50 03

Update push token after the initial setContext

Hi,
I'm using Firebase messaging to get the device token and send it to Segment, using

await Segment.setContext({
  'device': {
    'token': yourTokenString
  },
});
await Segment.track(eventName: 'Application Opened');

the thing is, that Firebase has an 'onTokenRefresh' event, where the might be updated.
in that case - how do I update the token? if I use the code above, and the only way the token is propagated is by calling Segment.track(eventName: 'Application Opened'); then that might mess up my events, won't it?

Why is the Segment.screen() method called in the build() method?

Hi,

As I understand, the build method can be called multiple times per second, and this track screen function is a method channel. Was this intention? or what's the best practice to log a screen without it being called multiple times in the same screen session?

Google Play policies violation in flutter_segment 3.7.0

After pushing another update for the app I am currently working on I saw the following warning in Play Developer Console:

The following SDK versions are non compliant with Google Play policies:

com.segment.analytics.android:analytics:4.10.0
The SDK collects personal or sensitive data that includes but may not be limited to Advertising ID, Android ID identifiers. Persistent device identifiers may not be linked to other personal and sensitive user data or resettable device identifiers as described in the User Data policy.

Starting from August 9, 2022 midnight (UTC), new app releases containing the SDK version(s) that do not comply with the User Data policy will be blocked from release. You may consider moving to another SDK; removing this SDK; or if available from your SDK provider, upgrading to a policy-compliant version of this SDK that does not include the violating code.

According to the information provided by your SDK provider, you may consider upgrading to4.10.1. Please consult the SDK provider for further information.

Read through the User Data policy for more details, and how to submit an updated app for review here.

If you've reviewed the policy and feel our decision may have been in error, please reach out to our policy support team.

Checked the Segment Android SDK and saw that in 4.10.1 the issue was resolved: https://github.com/segmentio/analytics-android/blob/master/CHANGELOG.md#version-4101-jan-11-2022

Considering that 9th of August is pretty soon already and release cycle of flutter_segment isn't that short, it is worth to update the Segment Android SDK and release an update for the flutter_segment.

Issues occurs with flutter_segment 3.7.0

P.S. I will open a PR with needed changes.

Avoid having all integrations in the same package

Current

We add integration with things like amplitude, firebase and so on and that requires that the dependency is added on each platform like this:

PRs related to this:

This makes that the effort made by the Segment team to avoid having a big library and instead adding the dependencies you need on your project pretty bad.

Expected

Somehow if I should be able to include the dependencies I need for each platform and just those.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.