-
Notifications
You must be signed in to change notification settings - Fork 11
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 screen tracking parameters #167
chore: update screen tracking parameters #167
Conversation
Sample app builds 📱Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.
|
final bool? debugModeEnabled; | ||
final bool? screenTrackingEnabled; | ||
final bool debugModeEnabled; | ||
final bool screenTrackingEnabled; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because these are only app settings, I updated them to non-nullable
@@ -108,15 +108,6 @@ extension AmiAppStringExtensions on String { | |||
} | |||
} | |||
|
|||
extension AmiAppIntExtensions on int { | |||
String? toTrimmedString() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we now use Int for flush properties, we no longer need this extension
return _platform.identify(userId: userId, traits: traits); | ||
{required String userId, Map<String, dynamic> traits = const {}}) { | ||
return _platform.identify( | ||
userId: userId, traits: traits.excludeNullValues()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excluded null
from all currently implemented functions, as we don't currently support null
attributes in native SDKs. Open to any suggestions if there are other ideas on how to handle this!
extension CustomerIOMapExtension on Map<String, dynamic> { | ||
/// Returns a new map with entries that have non-null values, excluding null values. | ||
Map<String, dynamic> excludeNullValues() { | ||
return Map.fromEntries(entries.where((entry) => entry.value != null)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return Map.fromEntries(entries.where((entry) => entry.value != null)); | |
return map.removeWhere((key, value) => value == null); |
not this exact place but dart provides this utility method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It definitely sounds good, but I deliberately avoided modifying the same map because removing items directly could unintentionally alter customer provided map, which might cause issues in their app. So I created a new map instance to avoid any potential side effects.
closes: MBL-634
Changes
screen
method to use revised parameter namesCode Changes
Before
After