Skip to content
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

Throw exception when properties with int array #507

Closed
deltaguita opened this issue Feb 20, 2017 · 2 comments
Closed

Throw exception when properties with int array #507

deltaguita opened this issue Feb 20, 2017 · 2 comments

Comments

@deltaguita
Copy link

deltaguita commented Feb 20, 2017

sdk version : 4.2.6

My code:

int[] value = ArrayUtils.toPrimitive(set.toArray(new Integer[set.size()])); // [1,2,3]
Analytics.with(getContext()).track(AnalyticsConstants.EVENT_CHOOSE_INTEREST_AGE
                ,new Properties().putValue(AnalyticsConstants.KEY_TYPE,"confirm")
                        .putValue(AnalyticsConstants.KEY_AGES, value));

Stack trace:

event=Click choose interest age, properties={type=confirm, ages=[I@79f9eef}} to queue: com.segment.analytics.PayloadQueue$PersistentQueue@59c281d.
                                                                         java.io.IOException: Incomplete document
                                                                             at android.util.JsonWriter.close(JsonWriter.java:396)
                                                                             at com.segment.analytics.Cartographer.toJson(Cartographer.java:96)
                                                                             at com.segment.analytics.SegmentIntegration.performEnqueue(SegmentIntegration.java:242)
                                                                             at com.segment.analytics.SegmentIntegration$SegmentDispatcherHandler.handleMessage(SegmentIntegration.java:447)
                                                                             at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                             at android.os.Looper.loop(Looper.java:158)
                                                                             at android.os.HandlerThread.run(HandlerThread.java:61)
@f2prateek
Copy link
Contributor

This isn't supported. Send a List of integers. You can replace int[] value = ArrayUtils.toPrimitive(set.toArray(new Integer[set.size()])); with List<Integer> value = new ArrayList<>(set);

@f2prateek
Copy link
Contributor

#508

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

No branches or pull requests

2 participants