Skip to content

Commit

Permalink
exclude null from traits
Browse files Browse the repository at this point in the history
  • Loading branch information
mrehan27 committed Nov 8, 2024
1 parent 6833e12 commit 566b4bc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/customer_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ class CustomerIO {
/// @param userId unique identifier for a profile
/// @param traits (Optional) params to set profile attributes
void identify(
{required String userId,
Map<String, dynamic> traits = const {}}) {
return _platform.identify(userId: userId, traits: traits);
{required String userId, Map<String, dynamic> traits = const {}}) {
return _platform.identify(
userId: userId, traits: traits.excludeNullValues());
}

/// Call this function to stop identifying a person.
Expand Down Expand Up @@ -151,7 +151,8 @@ class CustomerIO {
///
/// @param attributes additional attributes for a user profile
void setProfileAttributes({required Map<String, dynamic> attributes}) {
return _platform.setProfileAttributes(traits: attributes);
return _platform.setProfileAttributes(
traits: attributes.excludeNullValues());
}

/// Subscribes to an in-app event listener.
Expand Down

0 comments on commit 566b4bc

Please sign in to comment.