Skip to content
This repository was archived by the owner on Aug 12, 2022. It is now read-only.

Conversation

@benjiwheeler
Copy link
Contributor

Resolves

Proposed Changes

Adds setAnalyticsPref functions for iOS and Android
Adds functions in js to call those native functions, with a single interface

Copy link
Contributor

@chrisgarrity chrisgarrity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few changes. One of the main things is to make sure not to convert parameters to strings too early. One of the upcoming wkwebview changes is how parameters get passed, so while the two interfaces may look identical right now, they won't be soon

AndroidInterface.setAnalyticsPlacePref(preferredPlace);
}

static setAnalyticsPref (jsonStr) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter here should just be json, the interface should take care of stringify or whatever conversion is needed to pass to the native code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

window.tablet.setAnalyticsPlacePref(preferredPlace);
}

static setAnalyticsPref (jsonStr) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parameter should just be json, and this method should take care of the stringify.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

JSONArray jsonArray = jsonObject.names();
String key = jsonArray.getString(0);
String value = jsonObject.getString(key);
_FirebaseAnalytics.setUserProperty(key, value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's parsed in the interface this is much simpler.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Contributor

@chrisgarrity chrisgarrity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@benjiwheeler benjiwheeler merged commit d73abf1 into develop Aug 14, 2020
@benjiwheeler benjiwheeler deleted the set-analytics-pref branch August 14, 2020 18:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need generic firebase analytics setting function

3 participants