Skip to content

Commit

Permalink
chore: update adjust sdk (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesGitH authored Dec 10, 2024
1 parent 1fb1570 commit 3f56e3e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 20 deletions.
23 changes: 5 additions & 18 deletions packages/plugins/plugin_adjust/lib/plugin_adjust.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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) {
Expand Down Expand Up @@ -129,6 +116,6 @@ class AdjustDestination extends DestinationPlugin {

@override
reset() {
Adjust.resetSessionPartnerParameters();
Adjust.removeGlobalPartnerParameters();
}
}
10 changes: 10 additions & 0 deletions packages/plugins/plugin_adjust/lib/types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, String>? customEvents;
final int? delayTime;
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/plugin_adjust/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3f56e3e

Please sign in to comment.