It looks like the context and library information is missing on initial App Lifecycle events. The only thing I can think of is that there may be some kind of race condition with the initialization of the library and the sending of the first few lifecycle events.
analytics-react-native version: 2.1.4-beta
- React Native version: 0.64.3
- Both iOS and Android
Steps to reproduce
- Call createClient and attach appLifecycleEvents boolean:
const platformAnalytics = createClient({
writeKey: Platform.select({
ios: config.analytics.writeKeys.ios,
android: config.analytics.writeKeys.android,
default: '',
}),
trackAppLifecycleEvents: true,
trackDeepLinks: true,
});
- Reinstall and open app
Expected behavior
App Lifecycle events would come in with complete context and library information (like the other events do after initialization):
{
"context": {
"app": {
"build": "1.0.2",
"name": "App Name",
"namespace": "com.app",
"version": "1.0.2"
},
"device": {
"adTrackingEnabled": false,
"id": "XXXXX-XXX-XXX-XXX-XXXXX",
"manufacturer": "Apple",
"model": "iPhone12,1",
"name": "iPhone",
"type": "ios"
},
"ip": "XX.XXX.XXX.XX",
"library": {
"name": "@segment/analytics-react-native",
"version": "2.1.4-beta"
},
"locale": "en-US",
"network": {
"cellular": false,
"wifi": true
},
"os": {
"name": "iOS",
"version": "15.2.1"
},
"screen": {
"height": 896,
"width": 414
},
"timezone": "America/New_York",
"traits": {}
},
"event": "Application Installed",
...
}
Actual behavior
App Lifecycle events come in without any context or library information:
{
"context": {
"library": {
"name": "unknown",
"version": "unknown"
}
},
"event": "Application Installed",
...
}
It looks like the context and library information is missing on initial App Lifecycle events. The only thing I can think of is that there may be some kind of race condition with the initialization of the library and the sending of the first few lifecycle events.
analytics-react-nativeversion: 2.1.4-betaSteps to reproduce
Expected behavior
App Lifecycle events would come in with complete context and library information (like the other events do after initialization):
Actual behavior
App Lifecycle events come in without any context or library information: