Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update adjust sdk #128

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading