Question on expo-segment-analytics on iOS

Hey Expo community,

we’re using expo SDK 41 for our app, running on both iOS and Android. To ease up the pain of sending analytics directly to Mixpanel, we’ve added the expo-analytics-segment and using Segment in Cloud mode.

The source we have defined on Segment is a react native one, so we have only a single write key, that we use to initialise for both iOS and Android.

Our end destination is Mixpanel, also defined in our Segment setup.

We are seeing some inconsistency on which data is send to segment, based on OS.

Basically, we can see that the device information works fine on Android, with a payload looking as below.

{
“anonymousId”: “75ded5ed-d734-47a4-a444-5b0a934da543”,
“context”: {
“app”: {
“build”: “213”,
“name”: “Headlight Coaching”,
“namespace”: “com.weareheadlight.app2”,
“version”: “2.1.1”
},
“device”: {
“id”: “7005193e233b1c2c”,
“manufacturer”: “samsung”,
“model”: “SM-G950F”,
“name”: “dreamlte”,
“type”: “android”
},
[…]

on iOS, the device payload get nested, resulting in all events in the target destination (Mixpanel) to show as ‘undefined’ and not allowing us to get OS/device info for users on iOS.

The payload from iOS looks as below:
{
“anonymousId”: “B5E745DD-EAC4-4AB2-8B11-24F46E39B447”,
“context”: {
“app”: {
“build”: “3”,
“name”: “Headlight Coaching”,
“namespace”: “com.weareheadlight.app2”,
“version”: “2.1.1”
},
“device”: {
“device”: {
“id”: “D5373A99-5F16-4912-B5EB-64FF2DD08212”,
“manufacturer”: “Apple”,
“model”: “iPhone12,3”,
“name”: “iPhone”,
“type”: “ios”
},
“os”: {
“name”: “iOS”,
“version”: “14.6”
},
“screen”: {
“height”: 812,
“width”: 375
},
“type”: “ios”
},

Anyone having the same experience or any idea if we are doing something wrong?

From the expo segment SDK doc, it is mentioned that you need two different write keys for iOS and Android, does that means that identifying our app as React native is causing this issue?