Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
Enabled sending of user properties (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
j05u3 authored Apr 1, 2020
1 parent 682f92d commit 2f7a424
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 7.2.2-dev

- Enabled sending of user properties in analytics with `setUserProperties`.
- Removed unused (and unusable) `CustomParams` class.

## 7.2.1

- Mark intereop types `AuthProvider` and `OAuthCredential` anonymous.
Expand Down
12 changes: 3 additions & 9 deletions lib/src/analytics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ class Analytics extends JsObjectWrapper<analytics_interop.AnalyticsJsImpl> {
}
}

void setUserProperties(CustomParams properties,
void setUserProperties(Map<String, String> properties,
[AnalyticsCallOptions options]) {
if (options != null) {
jsObject.setUserProperties(properties.jsObject, options.jsObject);
jsObject.setUserProperties(jsify(properties), options.jsObject);
} else {
jsObject.setUserProperties(properties.jsObject);
jsObject.setUserProperties(jsify(properties));
}
}
}
Expand All @@ -65,9 +65,3 @@ class AnalyticsCallOptions
jsObject.global = t;
}
}

class CustomParams
extends JsObjectWrapper<analytics_interop.CustomParamsJsImpl> {
CustomParams._fromJsObject(analytics_interop.CustomParamsJsImpl jsObject)
: super.fromJsObject(jsObject);
}
7 changes: 1 addition & 6 deletions lib/src/interop/analytics_interop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ abstract class AnalyticsJsImpl {
external void setCurrentScreen(String screenName,
[AnalyticsCallOptionsJsImpl options]);
external void setUserId(String id, [AnalyticsCallOptionsJsImpl options]);
external void setUserProperties(CustomParamsJsImpl properties,
external void setUserProperties(Object properties,
[AnalyticsCallOptionsJsImpl options]);
}

Expand All @@ -23,8 +23,3 @@ class AnalyticsCallOptionsJsImpl {

external factory AnalyticsCallOptionsJsImpl({bool global});
}

@JS('CustomParams')
class CustomParamsJsImpl {
//TODO: implement
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: firebase
description: Firebase libraries for Dart on the web and server
version: 7.2.1
version: 7.2.2-dev
homepage: https://github.com/FirebaseExtended/firebase-dart

environment:
Expand Down

0 comments on commit 2f7a424

Please sign in to comment.