Skip to content

fix(firebase_dynamic_links): pass through utmParameters on iOS and make property on PendingDynamicLinkData. #8232

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

Merged
merged 3 commits into from
Mar 10, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
if (dynamicLink.minimumAppVersion) {
iosData[@"minimumVersion"] = dynamicLink.minimumAppVersion;
}
dictionary[@"utmParameters"] = dynamicLink.utmParametersDictionary;
dictionary[@"ios"] = iosData;
return dictionary;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class MethodChannelFirebaseDynamicLinks extends FirebaseDynamicLinksPlatform {
link: Uri.parse(link),
android: androidData,
ios: iosData,
utmParameters: linkData['utmParameters'],
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ import 'pending_dynamic_link_data_ios.dart';

/// Provides data from received dynamic link.
class PendingDynamicLinkData {
const PendingDynamicLinkData({required this.link, this.android, this.ios});
const PendingDynamicLinkData(
{required this.link,
this.android,
this.ios,
this.utmParameters = const {},
}
);

/// Provides Android specific data from received dynamic link.
///
Expand All @@ -24,11 +30,15 @@ class PendingDynamicLinkData {
/// Deep link parameter of the dynamic link.
final Uri link;

/// UTM parameters associated with a dynamic link.
final Map<String, String> utmParameters;

/// Returns the current instance as a [Map].
Map<String, dynamic> asMap() => <String, dynamic>{
'ios': ios?.asMap(),
'android': android?.asMap(),
'link': link.toString(),
'utmParameters': utmParameters
};

@override
Expand Down