From 063951ccca2f5d6992b445dc244c403393485c7e Mon Sep 17 00:00:00 2001 From: Hannes <33062605+HannesGitH@users.noreply.github.com> Date: Fri, 22 Nov 2024 18:12:31 +0100 Subject: [PATCH] chore: update adjust sdk --- .../plugin_adjust/lib/plugin_adjust.dart | 23 ++++--------------- packages/plugins/plugin_adjust/lib/types.dart | 10 ++++++++ packages/plugins/plugin_adjust/pubspec.yaml | 4 ++-- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/packages/plugins/plugin_adjust/lib/plugin_adjust.dart b/packages/plugins/plugin_adjust/lib/plugin_adjust.dart index 540439a..105caf0 100644 --- a/packages/plugins/plugin_adjust/lib/plugin_adjust.dart +++ b/packages/plugins/plugin_adjust/lib/plugin_adjust.dart @@ -57,32 +57,19 @@ class AdjustDestination extends DestinationPlugin { hasRegisteredCallback = true; } - final bufferingEnabled = adjustSettings!.setEventBufferingEnabled; - if (bufferingEnabled == true) { - adjustConfig.eventBufferingEnabled = bufferingEnabled; - } - - final useDelay = adjustSettings!.setDelay; - if (useDelay == true) { - final delayTime = adjustSettings!.delayTime; - if (delayTime != null) { - adjustConfig.delayStart = delayTime.toDouble(); - } - } - - Adjust.start(adjustConfig); + Adjust.initSdk(adjustConfig); } @override identify(event) async { final userId = event.userId; if (userId != null && userId.isNotEmpty) { - Adjust.addSessionPartnerParameter('user_id', userId); + Adjust.addGlobalPartnerParameter('user_id', userId); } final anonId = event.anonymousId; if (anonId != null && anonId.isNotEmpty) { - Adjust.addSessionPartnerParameter('anonymous_id', anonId); + Adjust.addGlobalPartnerParameter('anonymous_id', anonId); } return event; } @@ -91,7 +78,7 @@ class AdjustDestination extends DestinationPlugin { track(event) async { final anonId = event.anonymousId; if (anonId != null && anonId.isNotEmpty) { - Adjust.addSessionPartnerParameter('anonymous_id', anonId); + Adjust.addGlobalPartnerParameter('anonymous_id', anonId); } if (adjustSettings == null) { @@ -129,6 +116,6 @@ class AdjustDestination extends DestinationPlugin { @override reset() { - Adjust.resetSessionPartnerParameters(); + Adjust.removeGlobalPartnerParameters(); } } diff --git a/packages/plugins/plugin_adjust/lib/types.dart b/packages/plugins/plugin_adjust/lib/types.dart index 796c10c..66c048b 100644 --- a/packages/plugins/plugin_adjust/lib/types.dart +++ b/packages/plugins/plugin_adjust/lib/types.dart @@ -6,8 +6,18 @@ class AdjustSettings { final bool disabled; final String appToken; final bool? setEnvironmentProduction; + @Deprecated(""" + this setting has been removed in the adjust sdk + it will be removed in the next version of the plugin + and has currently no effect + """) final bool? setEventBufferingEnabled; final bool? trackAttributionData; + @Deprecated(""" + this setting has been removed in the adjust sdk + it will be removed in the next version of the plugin + and has currently no effect + """) final bool? setDelay; final Map? customEvents; final int? delayTime; diff --git a/packages/plugins/plugin_adjust/pubspec.yaml b/packages/plugins/plugin_adjust/pubspec.yaml index 6b7fdb8..bf8479a 100644 --- a/packages/plugins/plugin_adjust/pubspec.yaml +++ b/packages/plugins/plugin_adjust/pubspec.yaml @@ -1,6 +1,6 @@ name: segment_analytics_plugin_adjust description: The hassle-free way to add Segment analytics to your Flutter app. -version: 1.0.1 +version: 1.0.2 homepage: https://github.com/segmentio/analytics_flutter#readme repository: https://github.com/segmentio/analytics_flutter/tree/main/packages/plugins/plugin_adjust#readme issue_tracker: https://github.com/segmentio/analytics_flutter/issues @@ -14,7 +14,7 @@ dependencies: sdk: flutter segment_analytics: ^1.1.1 json_annotation: ^4.9.0 - adjust_sdk: ^4.38.2 + adjust_sdk: ^5.0.2 dev_dependencies: build_runner: ^2.4.7