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

Traits with object values are not serialised correctly #2

Closed
pwfcurry opened this issue Oct 25, 2018 · 1 comment · Fixed by expo/expo#2517
Closed

Traits with object values are not serialised correctly #2

pwfcurry opened this issue Oct 25, 2018 · 1 comment · Fixed by expo/expo#2517

Comments

@pwfcurry
Copy link

pwfcurry commented Oct 25, 2018

I'm trying to pass a "company" trait - map of values - to Expo.Segment.identify(..., traits).

In our android app, the "company" object is sent as a string of the JSON instead of a Map.

The offending method is here:
https://github.com/expo/expo-analytics-segment/blob/master/android/src/main/java/expo/modules/analytics/segment/SegmentModule.java#L60

Example raw payload:

{
  "traits": {
    "company": "{\"id\":\"abc123\", ...
    ...
}

"company" is defined as an object here: https://segment.com/docs/spec/identify/

This is handled correctly in iOS:

  "traits": {
    "company": {
      "id": "abc123",

Interestingly com.segment.analytics.Traits does not have any mention of company.

@sjchmiela
Copy link

Thank you for the issue submission! I think I fixed it in expo/expo#2517, you'll be able to test the fix yourself in the upcoming SDK 31. 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants