GithubHelp home page GithubHelp logo

datadog / dd-sdk-reactnative Goto Github PK

View Code? Open in Web Editor NEW
109.0 17.0 39.0 9.98 MB

Datadog SDK for ReactNative

License: Apache License 2.0

Java 0.09% JavaScript 1.53% Objective-C 0.42% Ruby 0.64% Kotlin 28.02% TypeScript 50.27% Swift 16.51% Makefile 0.16% Shell 0.22% Objective-C++ 2.06% C 0.08%
analytics error-monitoring react-native

dd-sdk-reactnative's Introduction

Datadog SDK for React Native

Datadog Real User Monitoring (RUM) enables you to visualize and analyze the real-time performance and user journeys of your application’s individual users.

Setup

See the dedicated Datadog React Native RUM Collection documentation to learn how to send RUM data from your React Native application to Datadog.

The RUM React Native SDK supports Expo. For more information, see the Expo documentation.

The RUM React Native SDK supports monitoring hybrid applications. For more information, see the hybrid app documentation.

The RUM React Native SDK supports OpenTelemetry and distributed traces through header generation. For more information, see the OpenTelemetry documentation.

Troubleshooting

If you encounter any issue when using the Datadog SDK for React Native, please take a look at the troubleshooting documentation, or at the existing issues.

Contributing

Pull requests are welcome. First, open an issue to discuss what you would like to change. For more information, read the Contributing Guide.

License

For more information, see Apache License, v2.0

dd-sdk-reactnative's People

Contributors

0xnm avatar alai97 avatar ashutoshd11 avatar buranmert avatar cltnschlosser avatar cswatt avatar cxz7720 avatar eliac123 avatar ganeshkumarsv avatar jonathanmos avatar jtappa avatar kayayarai avatar louiszawadzki avatar maelnamnam avatar marcadev-fc avatar marco-saia-datadog avatar mariusc83 avatar maxep avatar ncreated avatar pas256 avatar plousada avatar priyanshi-gupta avatar rlemasquerier avatar rtrieu avatar sarina-dd avatar stevoland avatar trevorah avatar voloshink avatar xgouchet avatar zerocho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dd-sdk-reactnative's Issues

after installation of beta3. "None of these files exist: * node_modules/dd-sdk-reactnative/src/rum/instrumentation/DdRumReactNativeNavigationTracking(.native..)"

Thanks for taking the time for reporting an issue!
Describe what happened
First of all i installed beta2 which got me the react-navigation error.
i checked this issue to solve it :
#76
but now i get the this error :
`Failed building JavaScript bundle.
Unable to resolve module ./rum/instrumentation/DdRumReactNativeNavigationTracking from /mnt/c/Users/nauman/Desktop/personal/kingchickenapp/node_modules/dd-sdk-reactnative/src/index.tsx:

None of these files exist:

  • node_modules/dd-sdk-reactnative/src/rum/instrumentation/DdRumReactNativeNavigationTracking(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
  • node_modules/dd-sdk-reactnative/src/rum/instrumentation/DdRumReactNativeNavigationTracking/index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)

1 | /*
2 | * Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
3 | * This product includes software developed at Datadog (https://www.datadoghq.com/).
4 | * Copyright 2016-Present Datadog, Inc.**Steps to reproduce the issue:** i only installed the latest version of the package and when i start the project i got this. **Describe what you expected:** to work. **Additional context** i am using the latest version of expo (41){
"main": "node_modules/expo/AppEntry.js",
"private": true,
"dependencies": {
"@babel/core": "~7.9.0",
"@babel/plugin-transform-react-jsx": "^7.3.0",
"@expo/vector-icons": "^12.0.0",
"@react-native-async-storage/async-storage": "^1.13.0",
"@react-native-community/masked-view": "0.1.10",
"@react-native-community/netinfo": "6.0.0",
"@react-navigation/bottom-tabs": "^5.11.11",
"@react-navigation/native": "^5.9.4",
"@react-navigation/stack": "^5.14.5",
"dd-sdk-reactnative": "^1.0.0-beta3",
"expo": "^41.0.1",
"expo-app-loading": "^1.0.3",
"expo-font": "~9.1.0",
"expo-linear-gradient": "~9.1.0",
"expo-notifications": "~0.11.6",
"expo-permissions": "~12.0.1",
"jsonwebtoken": "^8.5.1",
"native-base": "^2.15.2",
"react": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
"react-native-easy-grid": "^0.2.2",
"react-native-elements": "^1.0.0-beta5",
"react-native-gesture-handler": "~1.10.2",
"react-native-modal": "^11.5.3",
"react-native-qrcode": "^0.2.7",
"react-native-qrcode-svg": "^5.3.2",
"react-native-reanimated": "~2.1.0",
"react-native-safe-area-context": "3.2.0",
"react-native-screens": "~3.0.0",
"react-native-step-indicator": "^1.0.3",
"react-native-svg": "12.1.0",
"react-native-webview": "11.2.3",
"react-redux": "^7.2.4",
"react-timer-mixin": "^0.13.4",
"redux": "^4.1.0",
"restful.js": "^0.9.6",
"socket.io-client": "^4.1.2",
"styled-components": "^5.3.0",
"styled-system": "^5.1.5",
"unimodules-permissions-interface": "^6.1.0"
},
"devDependencies": {
"babel-eslint": "^10.0.3",
"eslint": "^6.5.1",
"eslint-config-airbnb": "^18.0.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.16.0",
"redux-devtools": "^3.7.0"
}
}
`
Thank you for your help.

can't find repo when building for Android

Not sure if this is a bug, but for me building on Android failed because it could not find the datadog repo. Maybe we could add something to the readme, to add this to repositories in the root build.gradle for Android:

allprojects {
    repositories {
        ...
        maven { url "https://dl.bintray.com/datadog/datadog-maven" }
    }
}

Is Error Tracking Feature working with this?

I can see my app's errors in RUM -> Sessions -> Errors, but not in UX Monitoring -> Error Tracking.

When I visit Error Tracking page, I see "Get started with Error Tracking" with two buttons "Set up RUM" and "Upload Source Maps". I already set up RUM, but I didn't upload the source code as I don't know how to upload React Native source code.

I'm curious whether I didn't set up properly or this feature is not yet ready.

I'm using "dd-sdk-reactnative": "^1.0.0-beta1", with following initialization

const config = new DdSdkReactNativeConfiguration(
  'REMOVED',
  __DEV__ ? 'development' : 'production',
  'REMOVED',
  true, // track User interactions (e.g.: Tap on buttons)
  true, // track XHR Resources
  true, // track Errors
);
// Optional: enable or disable native crash reports
config.nativeCrashReportEnabled = true;
DdSdkReactNative.initialize(config);

SDK initializes but doesn't send any info to Datadog

Describe what happened
SDK looks like it initializes, but the Datadog Rum site is stuck in the "Verify installation" phase and says "Waiting for data...".

Steps to reproduce the issue:
My index.js file looks like this:

import 'react-native-gesture-handler';
import { AppRegistry } from 'react-native';
import App from './App';
import { name as appName } from './app.json';
import {
  DdSdkReactNative,
  DdSdkReactNativeConfiguration,
  DdLogs,
} from 'dd-sdk-reactnative';

AppRegistry.registerRunnable(appName, async (props) => {
  const config = new DdSdkReactNativeConfiguration(
    'MY_CLIENT_TOKEN',
    'dev',
    'MY_APPLICATION_ID',
    true,
    true,
    true,
  );
  config.nativeCrashReportEnabled = true;
  config.sampleRate = 100;

  DdSdkReactNative.initialize(config)
    .then(() => {
      console.log('success');
      DdLogs.info('The RN Sdk was properly initialized', {
        bar: 'xyz',
        foo: 42,
      });

      DdSdkReactNative.setUser({
        email: '[email protected]',
        id: '1337',
        name: 'Xavier',
        type: 'premium',
      });

      DdSdkReactNative.setAttributes({ campaign: 'react-native-bs' });
    })
    .catch((err) => {
      console.log('Error in DD SDK', err);
    });
  AppRegistry.registerComponent(appName, () => App);
  AppRegistry.runApplication(appName, props);
});

It makes it to the console.log('success') line, but nothing shows up in Datadog.

Environment
Running inside iOS Simulator

Describe what you expected:
Because the initialization looks like it succeeded, I would expect some data to start flowing to Datadog. Does this not work from an iOS simulator?

Additional context
My package.json file:

{
  "name": "MyApp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@react-native-async-storage/async-storage": "^1.13.2",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-navigation/drawer": "^5.11.4",
    "@react-navigation/native": "^5.8.10",
    "@react-navigation/stack": "^5.12.8",
    "axios": "^0.21.1",
    "color": "^3.1.3",
    "dd-sdk-reactnative": "^1.0.0-beta1",
    "formik": "^2.2.6",
    "immutability-helper": "^3.1.1",
    "lodash.filter": "^4.6.0",
    "react": "16.13.1",
    "react-moment": "^1.1.1",
    "react-native": "0.63.4",
    "react-native-config": "^1.4.1",
    "react-native-elements": "^3.1.0",
    "react-native-fs": "^2.18.0",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-inappbrowser-reborn": "^3.5.1",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-loading-spinner-overlay": "^2.0.0",
    "react-native-modal": "^11.6.1",
    "react-native-paper": "^4.8.1",
    "react-native-reanimated": "^1.13.3",
    "react-native-safe-area-context": "^3.1.9",
    "react-native-screens": "^2.16.1",
    "react-native-sensitive-info": "^6.0.0-alpha.9",
    "react-native-vector-icons": "^7.1.0",
    "react-redux": "^7.2.2",
    "reanimated-bottom-sheet": "^1.0.0-alpha.22",
    "redux": "^4.0.5",
    "redux-devtools-extension": "^2.13.8",
    "redux-persist": "^6.0.0",
    "redux-thunk": "^2.3.0",
    "styled-components": "^5.2.3",
    "tailwind-rn": "^3.0.1",
    "yup": "^0.32.8"
  },
  "devDependencies": {
    "@babel/core": "^7.8.4",
    "@babel/runtime": "^7.8.4",
    "@react-native-community/eslint-config": "^1.1.0",
    "detox": "^18.0.2",
    "eslint": "^7.16.0",
    "eslint-config-airbnb": "^18.2.1",
    "eslint-plugin-detox": "^1.0.0",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-jsx-a11y": "^6.4.1",
    "eslint-plugin-react": "^7.21.5",
    "eslint-plugin-react-hooks": "^4.2.0",
    "eslint-plugin-sort-keys-fix": "^1.1.1",
    "jest": "^26.6.3",
    "jest-circus": "^26.6.3",
    "metro-react-native-babel-preset": "^0.59.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

Unstable onPress reference with interaction tracking enabled

Hey! We're observing that components that accept an onPress prop are getting different onPress references on each render, despite passing what should be the same reference. This is causing components with an onPress callback that we've React.memoed to re-render when they shouldn't be.

Steps to reproduce the issue:
This should affect components that have an onPress function prop that are React.memoed — we've reproduced it in our app with a component like:

import React from 'react';
import { Text } from 'react-native';

interface Props {
  text: string;
  onPress: () => void;
}
const FooBar: React.FC<Props> = ({ text, onPress }) => {
  console.log('Rendering FooBar');
  return <Text>{text}</Text>;
};

const propsAreEqual = (prevProps: Props, nextProps: Props) => {
  console.log('--- props are equal...')
  console.log(`onPress: `, prevProps.onPress === nextProps.onPress);
  console.log(`text: ${prevProps.text === nextProps.text}`)
  return (
    prevProps.text === nextProps.text &&
    prevProps.onPress === nextProps.onPress
  );
};
const FooBarMemo = React.memo(FooBar, propsAreEqual);

const ParentOfFooBar = () => {
  const foobarCallback = useCallback(() => {
    console.log('foobarCallback');
  }, []);
  // FooBarMemo re-renders anytime ParentOfFooBar re-renders
  return (
    <FooBarMemo onPress={foobarCallback} text="hello world foobar" />
  );
};

with SDK configuration that looks like this:

const config = new DdSdkReactNativeConfiguration(
  '...',
  environment,
  '...',
  true, // track User interactions
  true, // track XHR Resources
  true, // track Errors
);

Disabling interaction tracking allows the component to not re-render as expected.

I believe this is due to the onPress function being replaced every render here:

props.onPress = (...args: any[]) => {
DdRumUserInteractionTracking.eventsInterceptor.interceptOnPress(...args)
return originalOnPress(...args)
}

We're able to side-step this by disabling interaction tracking.

We're using @datadog/[email protected].

Example does not create RUM Session

Describe what happened
The final step of creating a RUM Application on the dashboard is not completed when using the example application.

Steps to reproduce the issue:

  1. Install packages in dd-sdk-reactnative via yarn
  2. Install packages in example/ via yarn
  3. In example/src/ddCredentials.ts set the values
export const CLIENT_TOKEN = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
export const ENVIRONMENT = "dev"
export const APPLICATION_ID = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
  1. Run command yarn start in example/
  2. Run command yarn android in example/
  3. Click "Main" button inside app
  4. Click back arrow in header

Describe what you expected:
Expected the a RUM session to be detected on the Datadog RUM application but it remains at "waiting for data"

image

Additional context
- Version of the SDK
- A copy of your package.json file
Run on version 1.0.0-rc4 from this repo

startTrackingViews function not triggering any RUM sessions from Test Flight build

Describe what happened
I have everything working locally in the iOS Simulator and can see sessions in the RUM explorer and can also see logs. However, after I deploy the app to Test Flight and download on my phone, it doesn't look like any sessions are being tracked. I have verified that my configuration is correct. Are there any differences that could be causing this? Any settings that could be preventing the network call to Datadog from being sent from my device?

It's odd that everything works perfectly locally, but can't get anything to work from my device with a Test Flight build.

Steps to reproduce the issue:
Upload a working example to TestFlight and download on a device.

Describe what you expected:
Expected the same behavior as locally on the iOS simulator - calling startTrackingViews should cause a new session to appear in the RUM explorer.

Additional context
package.json file:

{
  "name": "MyApp",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint ."
  },
  "dependencies": {
    "@react-native-async-storage/async-storage": "^1.13.2",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-navigation/drawer": "^5.11.4",
    "@react-navigation/native": "^5.8.10",
    "@react-navigation/stack": "^5.12.8",
    "axios": "^0.21.1",
    "color": "^3.1.3",
    "dd-sdk-reactnative": "^1.0.0-beta1",
    "formik": "^2.2.6",
    "immutability-helper": "^3.1.1",
    "lodash.filter": "^4.6.0",
    "react": "16.13.1",
    "react-moment": "^1.1.1",
    "react-native": "0.63.4",
    "react-native-config": "^1.4.1",
    "react-native-elements": "^3.1.0",
    "react-native-fs": "^2.18.0",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-inappbrowser-reborn": "^3.5.1",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-loading-spinner-overlay": "^2.0.0",
    "react-native-modal": "^11.6.1",
    "react-native-paper": "^4.8.1",
    "react-native-reanimated": "^1.13.3",
    "react-native-safe-area-context": "^3.1.9",
    "react-native-screens": "^2.16.1",
    "react-native-sensitive-info": "^6.0.0-alpha.9",
    "react-native-vector-icons": "^7.1.0",
    "react-redux": "^7.2.2",
    "reanimated-bottom-sheet": "^1.0.0-alpha.22",
    "redux": "^4.0.5",
    "redux-devtools-extension": "^2.13.8",
    "redux-persist": "^6.0.0",
    "redux-thunk": "^2.3.0",
    "styled-components": "^5.2.3",
    "tailwind-rn": "^3.0.1",
    "yup": "^0.32.8"
  },
  "devDependencies": {
    "@babel/core": "^7.8.4",
    "@babel/runtime": "^7.8.4",
    "@react-native-community/eslint-config": "^1.1.0",
    "detox": "^18.0.2",
    "eslint": "^7.16.0",
    "eslint-config-airbnb": "^18.2.1",
    "eslint-plugin-detox": "^1.0.0",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-jsx-a11y": "^6.4.1",
    "eslint-plugin-react": "^7.21.5",
    "eslint-plugin-react-hooks": "^4.2.0",
    "eslint-plugin-sort-keys-fix": "^1.1.1",
    "jest": "^26.6.3",
    "jest-circus": "^26.6.3",
    "metro-react-native-babel-preset": "^0.59.0"
  },
  "jest": {
    "preset": "react-native"
  }
}

Are you able to support Android SDK version 21?

I am getting the following error when I build.

Additional context

Task :dd-sdk-reactnative:processDebugAndroidTestManifest FAILED
[androidx.vectordrawable:vectordrawable-animated:1.0.0] .gradle\caches\transforms-3\f14803a315f67746b9fb71068be927be\transformed\vectordrawable-animated-1.0.0\AndroidManifest.xml Warning:
Package name 'androidx.vectordrawable' used in: androidx.vectordrawable:vectordrawable-animated:1.0.0, androidx.vectordrawable:vectordrawable:1.0.1.
\node_modules\dd-sdk-reactnative\android\build\intermediates\tmp\manifest\androidTest\debug\manifestMerger2972781339863275701.xml:5:5-74 Error:
uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [com.facebook.react:react-native:0.64.2] .gradle\caches\transforms-3\90a8cc388b0622ca7803b1b02bc7114f\transformed\jetified-react-native-0.64.2\AndroidManifest.xml as the library might be using APIs not available in 19
Suggestion: use a compatible library with a minSdk of at most 19,
or increase this project's minSdk version to at least 21,
or use tools:overrideLibrary="com.facebook.react" to force usage (may lead to runtime failures)

See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':dd-sdk-reactnative:processDebugAndroidTestManifest'.

Manifest merger failed with multiple errors, see logs

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 18s
220 actionable tasks: 20 executed, 200 up-to-date

Support for Expo Managed Workflow

Thanks for taking the time for reporting an issue!

Describe what happened

The build of my react native expo application which uses dd-sdk-reactnative fails on IOS using eas build.
It looks like arm64 architecture is not supported at JSON encoder level (Mac M1 chip ??).

Steps to reproduce the issue:

  • Build a new expo managed app.
  • Add dd-sdk-reactnative dependency (1.0.0-alpha5)
  • Call dd-sdk-reactnative init method in App.tsx.
  • Launch a build using eas build (i've don't tried

Describe what you expected:
To be able to build my react native app on arm64 mac with dd-sdk-reactnative.

Additional context
- version : 1.0.0-alpha5

The xcode build failure (on expo EAS IOS build server) :

Undefined symbols for architecture arm64:
  "Network.NWPath.isConstrained.getter : Swift.Bool", referenced from:
      closure #1 (Network.NWPath) -> () in Datadog.NWPathNetworkConnectionInfoProvider.init(monitor: Network.NWPathMonitor) -> Datadog.NWPathNetworkConnectionInfoProvider in libDatadogSDK.a(NetworkConnectionInfoProvider.o)
  "static Foundation.JSONEncoder.OutputFormatting.withoutEscapingSlashes.getter : Foundation.JSONEncoder.OutputFormatting", referenced from:
      function signature specialization <Arg[0] = Dead> of static (extension in Datadog):Foundation.JSONEncoder.default() -> Foundation.JSONEncoder in libDatadogSDK.a(JSONEncoder.o)
  "(extension in Foundation):__C.NSFileHandle.readToEnd() throws -> Foundation.Data?", referenced from:
      Datadog.File.read() throws -> Foundation.Data in libDatadogSDK.a(File.o)
  "(extension in Foundation):__C.NSFileHandle.seekToEnd() throws -> Swift.UInt64", referenced from:
      Datadog.File.append(data: Foundation.Data) throws -> () in libDatadogSDK.a(File.o)
  "(extension in Foundation):__C.NSFileHandle.write<A where A: Foundation.DataProtocol>(contentsOf: A) throws -> ()", referenced from:
      Datadog.File.append(data: Foundation.Data) throws -> () in libDatadogSDK.a(File.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

my package.json

{
  "main": "index.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@expo-google-fonts/inter": "^0.1.0",
    "@react-native-async-storage/async-storage": "^1.13.0",
    "@react-native-community/masked-view": "0.1.10",
    "@react-navigation/native": "^5.9.4",
    "@react-navigation/stack": "^5.14.4",
    "dd-sdk-reactnative": "^1.0.0-alpha5",
    "expo": "~41.0.1",
    "expo-app-loading": "^1.0.3",
    "expo-location": "~12.0.4",
    "expo-notifications": "~0.11.6",
    "expo-sms": "~9.1.2",
    "expo-status-bar": "~1.0.4",
    "expo-task-manager": "~9.1.0",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
    "react-native-elements": "^3.4.1",
    "react-native-gesture-handler": "~1.10.2",
    "react-native-reanimated": "~2.1.0",
    "react-native-safe-area-context": "3.2.0",
    "react-native-screens": "~3.0.0",
    "react-native-web": "~0.13.12",
    "tailwind-rn": "^3.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.9.0",
    "@types/react": "~16.9.35",
    "@types/react-native": "~0.63.2",
    "typescript": "~4.0.0"
  },
  "private": true
}

Bundle error: `react-native-navigation could not be found within the project`

Describe what happened
1.0.0-beta2 introduced a bundle error when the project does not use react-native-navigation.

I believe the issue was introduced just recently in #49. It also does not reproduce in 1.0.0-beta1.

Here's an excerpt from one of our CI runs:

error Unable to resolve module react-native-navigation from /home/circleci/project/mobile-app/node_modules/dd-sdk-reactnative/src/rum/instrumentation/DdRumReactNativeNavigationTracking.tsx: react-native-navigation could not be found within the project or in these directories:
  node_modules
  /home/circleci/project/mobile-app/node_modules/react-native-navigation

If you are sure the module exists, try these steps:
 1. Clear watchman watches: watchman watch-del-all
 2. Delete node_modules and run yarn install
 3. Reset Metro's cache: yarn start --reset-cache
 4. Remove the cache: rm -rf /tmp/metro-*
   6 |
Error: Unable to resolve module react-native-navigation from /home/circleci/project/mobile-app/node_modules/dd-sdk-reactnative/src/rum/instrumentation/DdRumReactNativeNavigationTracking.tsx: react-native-navigation could not be found within the project or in these directories:
   6 |
   7 | import React from 'react'
  node_modules
>  8 | import { ComponentDidAppearEvent, Navigation } from 'react-native-navigation';
  /home/circleci/project/mobile-app/node_modules/react-native-navigation
     |                                                      ^
   9 | import { DdRum } from '../../foundation';
  10 |
  11 | /**.
    at ModuleResolver.resolveDependency (/home/circleci/project/mobile-app/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:234:15)
    at DependencyGraph.resolveDependency (/home/circleci/project/mobile-app/node_modules/metro/src/node-haste/DependencyGraph.js:413:43)
    at Object.resolve (/home/circleci/project/mobile-app/node_modules/metro/src/lib/transformHelpers.js:317:42)
    at resolve (/home/circleci/project/mobile-app/node_modules/metro/src/DeltaBundler/traverseDependencies.js:629:33)
    at /home/circleci/project/mobile-app/node_modules/metro/src/DeltaBundler/traverseDependencies.js:645:26
    at Array.reduce (<anonymous>)
    at resolveDependencies (/home/circleci/project/mobile-app/node_modules/metro/src/DeltaBundler/traverseDependencies.js:644:33)
    at /home/circleci/project/mobile-app/node_modules/metro/src/DeltaBundler/traverseDependencies.js:329:33
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (/home/circleci/project/mobile-app/node_modules/metro/src/DeltaBundler/traverseDependencies.js:137:24)
info Run CLI with --verbose flag for more details.

Steps to reproduce the issue:

Bundle an app with dd-sdk-reactnative at version 1.0.0-beta2 and react-navigation but without react-native-navigation. Make sure to configure the SDK as described in the Readme.

Describe what you expected:

No bundle error

Additional context
- Version of the SDK 1.0.0-beta2
- A copy of your package.json file

react-native 0.64 support

Project with react-native 0.64 and dd-sdk-reactnative 1.0.0-beta1 fail to compile on Android with the following error:

> Task :dd-sdk-reactnative:processDebugAndroidTestManifest FAILED
[androidx.vectordrawable:vectordrawable-animated:1.0.0] Warning:
	Package name 'androidx.vectordrawable' used in: androidx.vectordrawable:vectordrawable-animated:1.0.0, androidx.vectordrawable:vectordrawable:1.0.1.
	uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [com.facebook.react:react-native:0.64.2] as the library might be using APIs not available in 19

react-native bumped minSdkVersion to 21: https://reactnative.dev/blog/2021/03/12/version-0.64#major-dependency-version-changes

Bumping minSdkVersion here: https://github.com/DataDog/dd-sdk-reactnative/blob/main/android/build.gradle#L32 fixes the issue but I haven't done much testing beyond this.

Source Discrepancy

Describe what happened
Update the SDK to the latest RC (1.0.0-rc3) and noticed the source that shows in Datadog for iOS logs is react-native while for Android, the source is Android.

iOS
Screen Shot 2021-11-02 at 11 20 52 AM

Android
Screen Shot 2021-11-02 at 11 20 19 AM

Steps to reproduce the issue:

  1. Follow the setup steps outlined in the README
  2. Send any log from your React Native iOS and Android apps
  3. Noticed the difference.

Describe what you expected:
All my logs are coming from React Native so I would expect the source to be react-native for both platforms. This didn't use to be a problem on the previous version of the SDK we were using (1.0.0-beta3)

Additional context
- Version of the SDK: 1.0.0-rc3

Custom Service Name

Support setting a custom Service name instead of using the package name through additionalConfig. Searching through the docs/code I don't see any way to set it for react-native. I know this is possible on web.

DatadogSDK/Datadog.modulemap' not found

Thanks for taking the time for reporting an issue!

Describe what happened
When tried to build using xcode got this error
fatal error: module map file '/Users/artemyeldinov/Library/Developer/Xcode/DerivedData/aquatyMobile-dwypirnlfstqyyfbtiwxuwdciyni/Build/Products/Debug-iphonesimulator/DatadogSDK/Datadog.modulemap' not found
1 error generated.

Steps to reproduce the issue:
Just try to run xcode build

Describe what you expected:
to build to be crated

Additional context

{
  "name": "aquatymobile",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start",
    "test": "jest",
    "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
    "debug": "open 'rndebugger://set-debugger-loc?host=localhost&port=8081'",
    "build-storybook": "build-storybook",
    "prestorybook": "rnstl",
    "storybook": "start-storybook -p 7007",
    "build-react": "webpack --mode production",
    "start-react": "webpack-dev-server --config ./webpack.config.js --mode development",
    "start-storybook-web": "./node_modules/@storybook/react/bin/index.js",
    "build-storybook-web": "./node_modules/@storybook/react/bin/build.js",
    "storybook-web": "yarn run start-storybook-web"
  },
  "dependencies": {
    "@datadog/mobile-react-native": "^1.0.0-rc2",
    "@datadog/mobile-react-navigation": "^1.0.0-rc2",
    "@react-navigation/bottom-tabs": "^6.0.5",
    "@react-navigation/native": "^6.0.2",
    "@react-navigation/native-stack": "^6.1.0",
    "cocoapods": "^0.0.0",
    "react": "17.0.2",
    "react-native": "0.64.1",
    "react-native-safe-area-context": "^3.3.2",
    "react-native-screens": "^3.6.0",
    "react-native-web": "^0.17.1",
    "react-redux": "^7.2.4",
    "redux": "^4.1.1",
    "redux-devtools-extension": "^2.13.9",
    "redux-saga": "^1.1.3",
    "remote-redux-devtools": "^0.5.16",
    "styled-components": "^5.3.1"
  },
  "devDependencies": {
    "@babel/core": "^7.15.5",
    "@babel/preset-env": "^7.15.6",
    "@babel/preset-react": "^7.14.5",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "@storybook/addon-actions": "^6.3.8",
    "@storybook/addon-essentials": "^6.3.8",
    "@storybook/addon-knobs": "^5.3",
    "@storybook/addon-links": "^6.3.8",
    "@storybook/addon-ondevice-actions": "^5.3.23",
    "@storybook/addon-ondevice-knobs": "^5.3.25",
    "@storybook/react": "^6.3.8",
    "@storybook/react-native": "^5.3.25",
    "@storybook/react-native-server": "^5.3.23",
    "@testing-library/jest-native": "^4.0.2",
    "@testing-library/react-native": "^7.2.0",
    "@types/jest": "^26.0.23",
    "@types/react": "^17.0.20",
    "@types/react-dom": "^17.0.9",
    "@types/react-native": "^0.64.5",
    "@types/react-test-renderer": "^16.9.2",
    "@types/remote-redux-devtools": "^0.5.5",
    "@types/styled-components": "^5.1.14",
    "babel-jest": "^26.6.3",
    "babel-loader": "^8.2.2",
    "css-loader": "^6.2.0",
    "eslint": "^7.14.0",
    "html-webpack-plugin": "^5.3.2",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "^0.64.0",
    "mini-css-extract-plugin": "^2.3.0",
    "react-dom": "^17.0.2",
    "react-native-storybook-loader": "^2.0.4",
    "react-test-renderer": "17.0.1",
    "source-map-loader": "^3.0.0",
    "storybook-addon-styled-component-theme": "^2.0.0",
    "ts-loader": "^9.1.2",
    "typescript": "^4.4.3",
    "webpack": "^5.52.1",
    "webpack-cli": "^4.8.0",
    "webpack-dev-server": "^4.2.1"
  },
  "resolutions": {
    "@types/react": "^17"
  },
  "config": {
    "react-native-storybook-loader": {
      "searchDir": [
        "./src/components"
      ],
      "pattern": "./**/*.stories.@(js|jsx|ts|tsx)",
      "outputFile": "./storybook/storyLoader.js"
    }
  },
  "jest": {
    "preset": "react-native",
    "setupFiles": [
      "./node_modules/react-native-gesture-handler/jestSetup.js"
    ],
    "transformIgnorePatterns": [
      "node_modules/(?!(jest-)?@?react-native|@react-native-community|@react-navigation)"
    ],
    "setupFilesAfterEnv": [
      "@testing-library/jest-native/extend-expect"
    ],
    "moduleFileExtensions": [
      "ts",
      "tsx",
      "js",
      "jsx",
      "json",
      "node"
    ],
    "globals": {
      "window": {}
    }
  }
}

TypeError: Cannot read property 'initialize' of undefined

Describe what happened
When installing dd-sdk-reactnative and following the installation instructions, I am seeing an error

TypeError: Cannot read property 'initialize' of undefined
    at DdSdkReactNative.tsx:38
    at new Promise (es.promise.js:235)
    at Function.initialize (DdSdkReactNative.tsx:30)
    at initializeDDSdk$ (LoggingProvider.tsx:16)
    at tryCatch (runtime.js:63)
    at Generator.invoke [as _invoke] (runtime.js:293)
    at Generator.next (runtime.js:118)
    at tryCatch (runtime.js:63)
    at invoke (runtime.js:154)
    at runtime.js:189

Steps to reproduce the issue:

  1. yarn add dd-sdk-reactnative
  2. follow instructions to initialize as here:
import { DdSdkReactNative, DdSdkReactNativeConfiguration } from 'dd-sdk-reactnative';

const config = new DdSdkReactNativeConfiguration(
    "<TOKEN>", 
    "<ENVIRONMENT_NAME>", 
    "<TOKEN>", ,
    true, // track User interactions (e.g.: Tap on buttons)
    true, // track XHR Resources
    true // track Errors
)
DdSdkReactNative.initialize(config)

Describe what you expected:
Instrumentation to connect to datadog backend

Additional context
- Version of the SDK: "dd-sdk-reactnative": "^1.0.0-beta1",
- A copy of your package.json file:

     "react": "16.13.1",
      "react-native": "0.63.4",

Feature Request: Clarify Expo Support

Our company currently uses the Expo managed workflow, it looks as though dd-sdk-react-native requires access to react-native 'Native Modules' which is fair enough 😆 I'm expecting the sdk requires me to eject to the Expo 'bare' workflow.

In the Expo managed workflow I get this error when trying to initialise.

[Unhandled promise rejection: TypeError: null is not an object (evaluating '_foundation.DdSdk.initialize')]
at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:516237:27 in <unknown>
at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:516229:26 in initialize
at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:515922:53 in <unknown>
at [native code]:null in callFunctionReturnFlushedQueue

It would be useful to us if in the docs you stated whether the 'Expo Managed Workflow' is supported.

It seems reasonable if it's not. Later in the year Expo is planning to add native module support with EAS build https://blog.expo.io/expo-managed-workflow-in-2021-d1c9b68aa10

Describe the solution you'd like
An update to the docs stating expo support. Or an option to use dd-sdk with the Expo Managed workflow

Describe alternatives you've considered
Eject expo, or wait for runtime customisation in expo to give native module support

Bitcode support

Is your feature request related to a problem? Please describe.
Yeah, Testflight reports that bitcode is not supported for my app since i added dd-sdk-reactnative

Describe the solution you'd like
Add bitcode to the native part of the iOS library

Describe alternatives you've considered
Right now, I am forced to uncheck Include bitcode for iOS content

Additional context
No

_react.default.createElement fails because props is read-only

An error is thrown at app launch
TypeError: Attempted to assign to readonly property.
at node_modules/@datadog/mobile-react-native/lib/commonjs/rum/instrumentation/DdRumUserInteractionTracking.js

Steps to reproduce the issue:

Launch app

Describe what you expected:

DataDog SDK does not cause app to crash on launch

Proposed Fix

In file DdRumUserInteractionTracking.js:

    _react.default.createElement = (element, props, ...children) => {
      // check if we have an 'onPress' property and that this is really a function
      if (props && typeof props.onPress === PROPERTY_FUNCTION_TYPE) {
        const originalOnPress = props.onPress;

        // [ arahn: 2022-01-12 ] props could be a read-only table, so make a copy
        const onPress = (...args) => {
          DdRumUserInteractionTracking.eventsInterceptor.interceptOnPress(...args);
          return originalOnPress(...args);
        };
        props = { ...props, onPress }
      }

Note

This was working. I recently have made an update to graphql, and suddenly this started happening. I'm assuming some dependency change somewhere has caused props to suddenly become a read-only table. This may not always happen, but evidently this can happen and the SDK should be coded defensively and not assume that props.onPress can be written to.

Unable to build for iOS

Unable to build iOS app when Data Dog RN SDK is added as a dependency.

React Native Version: 0.64.0

Describe what happened

Undefined symbols for architecture arm64:
  "Network.NWPath.isConstrained.getter : Swift.Bool", referenced from:
      closure #2 () -> Swift.Bool? in closure #1 (Network.NWPath) -> () in Datadog.NWPathNetworkConnectionInfoProvider.init(monitor: Network.NWPathMonitor) -> Datadog.NWPathNetworkConnectionInfoProvider in libDatadogSDK.a(NetworkConnectionInfoProvider.o)
  "Swift._ArrayBuffer._copyContents(initializing: Swift.UnsafeMutableBufferPointer<A>) -> (Swift.IndexingIterator<Swift._ArrayBuffer<A>>, Swift.Int)", referenced from:
      generic specialization <serialized, Swift._ArrayBuffer<Swift.Int8>> of Swift._copyCollectionToContiguousArray<A where A: Swift.Collection>(A) -> Swift.ContiguousArray<A.Element> in libDatadogSDK.a(ActiveSpansPool.o)
  "(extension in Foundation):__C.NSFileHandle.readToEnd() throws -> Foundation.Data?", referenced from:
      Datadog.File.read() throws -> Foundation.Data in libDatadogSDK.a(File.o)
  "static Foundation.JSONEncoder.OutputFormatting.withoutEscapingSlashes.getter : Foundation.JSONEncoder.OutputFormatting", referenced from:
      static (extension in Datadog):Foundation.JSONEncoder.default() -> Foundation.JSONEncoder in libDatadogSDK.a(JSONEncoder.o)
  "(extension in Foundation):__C.NSFileHandle.seekToEnd() throws -> Swift.UInt64", referenced from:
      Datadog.File.append(data: Foundation.Data) throws -> () in libDatadogSDK.a(File.o)
  "(extension in Foundation):__C.NSFileHandle.write<A where A: Foundation.DataProtocol>(contentsOf: A) throws -> ()", referenced from:
      Datadog.File.append(data: Foundation.Data) throws -> () in libDatadogSDK.a(File.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Screen Shot 2021-06-10 at 9 21 26 AM

Steps to reproduce the issue:

  1. yarn add dd-sdk-reactnative
  2. from project root: cd ios
  3. from ios folder: pod install
  4. follow instructions here: https://github.com/DataDog/dd-sdk-reactnative#readme
  5. open Xcode project and build

Describe what you expected:
For the app to build without error

Additional context
- Version of the SDK: 1.0.0-beta1
- A copy of your package.json file
package.json.txt

Runtime error on iOS 11

Hi DataDog team!

Here's an issue we encountered on our side related to using this SDK and running on iOS 11...

Describe what happened
With the package @datadog/mobile-react-native (version 1.0.0-rc2) installed in our React Native app, we get a runtime error with this error message: dyld: Symbol not found: _OBJC_CLASS_$_OS_dispatch_queue_serial.
The app then crashes.

Steps to reproduce the issue:

  • Install @datadog/mobile-react-native in a React Native (0.63.2) project.
  • Install pods: pod install --project-directory=ios
  • Run the app from Xcode on a simulator with iOS 11.4 installed.

Describe what you expected:

The application should be running without any issue.

Additional context
- Xcode 12.5
- Simulator 11.4
- React Native 0.63.2

This issue arises specifically from that line:
https://github.com/DataDog/dd-sdk-reactnative/blame/main/packages/core/ios/Sources/QueueHolder.swift

This file uses dispatch_queue_serial_t which is available only from iOS 12+.
Apple documentation: https://developer.apple.com/documentation/dispatch/dispatch_queue_serial_t

Commit that introduced the bug: c568d7f

Specific line: c568d7f#diff-0288ae99caf2c07d91fce825c748ddaa7b97c2514b32317bf3eb048257804436R9

Enabling error tracking makes the app stuck at start

Describe what happened

When we enable error tracking in DdSdkReactNativeConfiguration init, our application stuck on loading.

Steps to reproduce the issue:

npm install [email protected]
npx react-native run-android
adb logcat or look at the console using debugger

Describe what you expected:

Being able to track errors in our app without any blocking load.

Additional context
- Version of the bridge: 1.0.0-alpha3
- Version of Android SDK:

[...]
|    +--- com.datadoghq:dd-sdk-android:1.8.0-alpha1
|    |    +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.3.61
|    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.61 -> 1.4.21 (*)
|    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.0 -> 1.4.21 (*)
|    |    +--- com.squareup.okhttp3:okhttp:3.12.6 -> 3.14.1 (*)
|    |    +--- com.google.code.gson:gson:2.8.6
|    |    +--- com.lyft.kronos:kronos-android:0.0.1-alpha10
|    |    |    +--- com.lyft.kronos:kronos-java:0.0.1-alpha10
|    |    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 -> 1.4.21 (*)
|    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 -> 1.4.21 (*)
|    |    +--- androidx.core:core:1.3.1 (*)
|    |    +--- androidx.navigation:navigation-fragment:2.3.0
|    |    |    +--- androidx.fragment:fragment:1.2.4 (*)
|    |    |    \--- androidx.navigation:navigation-runtime:2.3.0
|    |    |         +--- androidx.navigation:navigation-common:2.3.0
|    |    |         |    +--- androidx.annotation:annotation:1.1.0
|    |    |         |    +--- androidx.core:core:1.1.0 -> 1.3.1 (*)
|    |    |         |    \--- androidx.collection:collection:1.1.0 (*)
|    |    |         +--- androidx.activity:activity:1.1.0 (*)
|    |    |         +--- androidx.lifecycle:lifecycle-viewmodel:2.2.0 (*)
|    |    |         +--- androidx.savedstate:savedstate:1.0.0 (*)
|    |    |         \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.2.0 (*)
|    |    +--- androidx.navigation:navigation-runtime-ktx:2.3.0
|    |    |    +--- androidx.navigation:navigation-runtime:2.3.0 (*)
|    |    |    +--- androidx.navigation:navigation-common-ktx:2.3.0
|    |    |    |    +--- androidx.navigation:navigation-common:2.3.0 (*)
|    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.71 -> 1.4.21 (*)
|    |    |    |    +--- androidx.core:core-ktx:1.1.0
|    |    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.31 -> 1.4.21 (*)
|    |    |    |    |    +--- androidx.annotation:annotation:1.1.0
|    |    |    |    |    \--- androidx.core:core:1.1.0 -> 1.3.1 (*)
|    |    |    |    \--- androidx.collection:collection:1.1.0 (*)
|    |    |    +--- androidx.activity:activity-ktx:1.1.0
|    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.4.21 (*)
|    |    |    |    +--- androidx.activity:activity:[1.1.0] -> 1.1.0 (*)
|    |    |    |    +--- androidx.core:core-ktx:1.1.0 (*)
|    |    |    |    +--- androidx.lifecycle:lifecycle-runtime-ktx:2.2.0
|    |    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.4.21 (*)
|    |    |    |    |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0
|    |    |    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.4.21 (*)
|    |    |    |    |    |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0
|    |    |    |    |    |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.4.21 (*)
|    |    |    |    |    |         \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.50 -> 1.4.21
|    |    |    |    |    +--- androidx.lifecycle:lifecycle-runtime:2.2.0 (*)
|    |    |    |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    |    \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0
|    |    |    |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.4.21 (*)
|    |    |    |         +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0 (*)
|    |    |    |         \--- androidx.lifecycle:lifecycle-viewmodel:2.2.0 (*)
|    |    |    +--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0 (*)
|    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.71 -> 1.4.21 (*)
|    |    +--- androidx.recyclerview:recyclerview:1.1.0 (*)
|    |    +--- androidx.work:work-runtime:2.4.0
|    |    |    +--- com.google.guava:listenablefuture:1.0
|    |    |    +--- androidx.lifecycle:lifecycle-livedata:2.1.0 (*)
|    |    |    +--- androidx.room:room-runtime:2.2.5
|    |    |    |    +--- androidx.room:room-common:[2.2.5] -> 2.2.5
|    |    |    |    |    \--- androidx.annotation:annotation:1.1.0
|    |    |    |    +--- androidx.sqlite:sqlite-framework:2.0.1 -> 2.1.0 (*)
|    |    |    |    +--- androidx.sqlite:sqlite:2.0.1 -> 2.1.0 (*)
|    |    |    |    \--- androidx.arch.core:core-runtime:2.0.1 -> 2.1.0 (*)
|    |    |    +--- androidx.sqlite:sqlite:2.1.0 (*)
|    |    |    +--- androidx.sqlite:sqlite-framework:2.1.0 (*)
|    |    |    +--- androidx.core:core:1.1.0 -> 1.3.1 (*)
|    |    |    \--- androidx.lifecycle:lifecycle-service:2.1.0
|    |    |         \--- androidx.lifecycle:lifecycle-runtime:2.1.0 -> 2.2.0 (*)
|    |    +--- io.opentracing:opentracing-api:0.32.0
|    |    +--- io.opentracing:opentracing-noop:0.32.0
|    |    |    \--- io.opentracing:opentracing-api:0.32.0
|    |    \--- io.opentracing:opentracing-util:0.32.0
|    |         +--- io.opentracing:opentracing-api:0.32.0
|    |         \--- io.opentracing:opentracing-noop:0.32.0 (*)
|    +--- com.datadoghq:dd-bridge-android:0.2.0
|    |    +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.3.61 (*)
|    |    +--- com.datadoghq:dd-sdk-android:1.8.0-alpha1 (*)
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.0 -> 1.4.21 (*)
|    +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.21 (*)
|    \--- com.github.xgouchet.Elmyr:core:1.2.0
|         \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.61 -> 1.4.21 (*)
- Version of iOS SDK:
PODS:
  [...]
  - DatadogSDK (1.5.1):
    - Kronos (~> 4.1)
  - DatadogSDKBridge (0.2.0):
    - DatadogSDK (~> 1.5.1)
  - dd-sdk-reactnative (1.0.0-alpha3):
    - DatadogSDKBridge (~> 0.2.0)
    - React
  - Kronos (4.2.1)
  - React (0.62.2)
- A copy of your `package.json` file
{
  "dependencies": {
    [...]
    "@react-navigation/bottom-tabs": "^5.11.7",
    "@react-navigation/native": "^5.9.2",
    "@react-navigation/stack": "^5.14.2",
    "dd-sdk-reactnative": "1.0.0-alpha3",
    "react": "16.11.0",
    "react-native": "0.62.2",
  },
  "engines": {
    "node": "12"
  }
}

iOS: Undefined symbols for architecture x86_64/arm64

Hello, DataDog team! :)

Describe what happened:
When trying to compile our app for iOS (react-native app), with freshly yarn added dd-sdk-reactnative, it fails with the following error:

Undefined symbols for architecture x86_64:
  "static Foundation.JSONEncoder.OutputFormatting.withoutEscapingSlashes.getter : Foundation.JSONEncoder.OutputFormatting", referenced from:
      static (extension in Datadog):Foundation.JSONEncoder.default() -> Foundation.JSONEncoder in libDatadogSDK.a(JSONEncoder.o)
  "Network.NWPath.isConstrained.getter : Swift.Bool", referenced from:
      closure #2 () -> Swift.Bool? in closure #1 (Network.NWPath) -> () in Datadog.NWPathNetworkConnectionInfoProvider.init(monitor: Network.NWPathMonitor) -> Datadog.NWPathNetworkConnectionInfoProvider in libDatadogSDK.a(NetworkConnectionInfoProvider.o)
  "(extension in Foundation):__C.NSFileHandle.readToEnd() throws -> Foundation.Data?", referenced from:
      Datadog.File.read() throws -> Foundation.Data in libDatadogSDK.a(File.o)
  "(extension in Foundation):__C.NSFileHandle.seekToEnd() throws -> Swift.UInt64", referenced from:
      Datadog.File.append(data: Foundation.Data) throws -> () in libDatadogSDK.a(File.o)
  "(extension in Foundation):__C.NSFileHandle.write<A where A: Foundation.DataProtocol>(contentsOf: A) throws -> ()", referenced from:
      Datadog.File.append(data: Foundation.Data) throws -> () in libDatadogSDK.a(File.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Steps to reproduce the issue:

  1. Install dd-sdk-reactnative in a react-native v0.63.4 project (ios/android)
  2. cd ios/ && pod install
  3. react-native run-ios

Describe what you expected:

I expected the build to succeed, as the one for Android does.

Additional context:

  • "dd-sdk-reactnative": "^1.0.0-alpha5",

Crash on startup

hello everyone, sorry for the newb question

i always got crash on startup when tried to import this SDK, its a debug apk, what is the minimum react-native need to use it ?

heres react-native version that we use
react-native-cli: 2.0.1
react-native: 0.60.5

already tried to look at logcat but theres seems no unusual problem popup

thank you in advance

[Feature Request] Be able to obtain trace propagation HTTP headers to manually propagate traces

Hi team! My team has been using a custom built DataDog React Native module that bridges the iOS/Android SDKs and just has the bare functionality that we need while we waited for this official DataDog React Native SDK. One thing we need is to be able to distribute traces from frontend to backend, so we followed the docs here: https://github.com/DataDog/dd-sdk-ios/blob/master/docs/trace_collection.md (see number 8). For each HTTP request we make in RN (we're using Apollo client graphql) we called a RN bridge function that, on the native side, would first start the span and use that HTTPHeadersWriter (iOS) or HttpHeadersInjectAdapter (Android) to obtain the headers, important one being the trace ID, and we returned that to JS over the bridge so that we could set the x-datadog-trace-id header on each request in an Apollo link. Then the span is stopped at the end of the request.

I have been checking out the beta of this SDK to see if we can start using it and get rid of our custom bridge, but it seems like there isn't yet a way to be able to do this manual propagation of traces, so we'd like to request this feature for a future version of the SDK!

If this is already possible with the SDK and I missed something please let me know!

Unable to send batch because of a network error

Describe what happened
Datadog is able to log locally, but can't submit the logs.

Screen Shot 2021-06-17 at 8 35 31 AM copy

Screen Shot 2021-06-17 at 9 48 51 AM copy

Steps to reproduce the issue:
iOS and Android, React-Native 0.62.2.

Describe what you expected:
Datadog logs are uploaded as expected.

Additional context
- Version of the SDK: dd-sdk-reactnative 1.0.0-beta1
- A copy of your package.json file: unable to provide

Is there a recommended way I can inspect what the network error is?

Make context optional

Is your feature request related to a problem? Please describe.
Several methods such as DdRum.addAction(), DdLogs.debug|info|warn|trace() all take an additional context object, it would be nice if in cases where context is just empty, that this object is optional and that the implementation handles whether or not a default empty context is supplied.

Describe the solution you'd like
DdRum.addAction('my_action', 'my_button', Date.getTime())
DdLogs.info('my info log')

Describe alternatives you've considered
The alternative in this case is to supply a default empty object. This ultimately clutters up the code and makes it less clear as to it's purpose and intent.

DdRum.addAction('my_action', 'my_button', Date.getTime(), {})
DdLogs.info('my info log', {})

Additional context

Android issue: null is not an object (evaluating 'this.nativeRum.startView')

Describe what happened
Include any error message or stack trace if available.

Everything works on iOS, and data comes through to my DataDog dashboard. When attempting to run on Android emulators I receive this error after the app successfully installs and opens: null is not an object (evaluating 'this.nativeRum.startView'). It points to the file foundation.tsx and line 50.

I also tried clearing all caches multiple times.

Here is the stack trace:
Screen Shot 2022-01-04 at 3 01 55 AM

Steps to reproduce the issue:

  • tested with a Pixel 4 emulator with API 28 (Android 9.0), and a Galaxy S20 Ultra emulator with API 30 (Android 11.0)

Describe what you expected:

Additional context
- Version of the SDK
- @datadog/[email protected]
- @datadog/[email protected]
- A copy of your package.json file:
- Note: I have ejected from expo

{
  "name": "",
  "scripts": {},
  "dependencies": {
    "@datadog/mobile-react-native": "^1.0.0-rc4",
    "@datadog/mobile-react-navigation": "^1.0.0-rc4",
    "@expo/vector-icons": "^12.0.0",
    "@ptomasroos/react-native-multi-slider": "^2.2.2",
    "@react-native-async-storage/async-storage": "^1.13.2",
    "@react-native-community/cli-platform-ios": "^4.13.0",
    "@react-native-community/cookies": "^5.0.1",
    "@react-native-community/masked-view": "^0.1.6",
    "@react-navigation/bottom-tabs": "^6.0.9",
    "@react-navigation/native": "^6.0.6",
    "@react-navigation/stack": "^6.0.11",
    "@unimodules/core": "~6.0.0",
    "@unimodules/react-native-adapter": "~5.7.0",
    "bcrypt": "^3.0.6",
    "blinkid-react-native": "^5.8.1",
    "expo": "^40.0.0",
    "expo-asset": "~8.2.1",
    "expo-constants": "~9.3.3",
    "expo-facebook": "~9.1.0",
    "expo-file-system": "~9.3.0",
    "expo-font": "~8.4.0",
    "expo-linear-gradient": "~8.4.0",
    "install": "^0.13.0",
    "lodash": "^4.17.15",
    "npm": "^8.3.0",
    "payment-icons": "^1.2.1",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-native": "0.63.4",
    "react-native-code-push": "^6.2.1",
    "react-native-datepicker": "^1.7.2",
    "react-native-dotenv": "^2.5.1",
    "react-native-elements": "^1.2.7",
    "react-native-firebase": "^5.6.0",
    "react-native-gesture-handler": "~1.8.0",
    "react-native-google-places-autocomplete": "^2.1.2",
    "react-native-indicators": "^0.17.0",
    "react-native-keyboard-aware-scroll-view": "^0.9.5",
    "react-native-onesignal": "^4.0.1",
    "react-native-picker-select": "^6.5.0",
    "react-native-reanimated": "^1.7.0",
    "react-native-rn-apple-pay-button": "github:brascene/rn-apple-pay-button",
    "react-native-safe-area-context": "^3.2.0",
    "react-native-screens": "^3.10.1",
    "react-native-sectioned-multi-select": "^0.8.1",
    "react-native-unimodules": "~0.12.0",
    "react-native-vector-icons": "^6.6.0",
    "react-native-video": "^5.0.0",
    "react-native-web": "~0.13.12",
    "react-redux": "^7.1.0",
    "redux": "^4.0.4",
    "redux-thunk": "^2.3.0",
    "tipsi-stripe": "^9.1.1"
  },
  "devDependencies": {
    "@babel/core": "~7.9.0",
    "@babel/runtime": "^7.8.4",
    "@types/react": "~16.9.35",
    "@types/react-native": "~0.63.2",
    "babel-jest": "~24.9.0",
    "babel-preset-expo": "8.3.0",
    "jest": "~24.9.0",
    "jetifier": "~1.6.4",
    "metro-react-native-babel-preset": "^0.59.0",
    "react-test-renderer": "~16.13.1",
    "typescript": "^4.5.4"
  },
  "private": true
}

Any help is appreciated!

Runtime error when using console.error with boolean or number values

Describe what happened:
When console.error is called in a react-native view, it causes a runtime error. This error is raised with specific types.

console.error(undefined) // Ok
console.error(null) // Ok
console.error(true) // Runtime error (right operand of 'in' is not an object)
console.error(1) // Runtime error (right operand of 'in' is not an object)
console.error('string') // Ok
console.error(() => undefined) // Ok
console.error({property1: undefined, property2: null, property3: true, property4: 1, property5: 'string', property6: () => undefined}) // Ok

It seems that the 'in' operator is called on primitive values causing the runtime error:

Steps to reproduce:
Calling the console.error function in a react-native view (with the native sdk @datadog/mobile-react-native).

Describe what you expected:
The sdk doesn't crash regardless of the type of data passed in the console.error function.

Additional context:
Version of the SDK - "@datadog/mobile-react-native": "1.0.0-rc4",

Error when pod install

Hello, please help, I'm getting error when running pod install in my project

Describe what happened
Getting error when run pod install

Steps to reproduce the issue:

Describe what you expected:

[!] The following Swift pods cannot yet be integrated as static libraries:

The Swift pod `dd-sdk-reactnative` depends upon `React-Core`, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set `use_modular_headers!` globally in your Podfile, or specify `:modular_headers => true` for particular dependencies.

Additional context
- Version of the SDK

"dd-sdk-reactnative": "^1.0.0-beta1",
- A copy of your `package.json` file
{
  "name": "apps",
  "version": "3.3.0",
  "private": true,
  "scripts": {
    "postinstall": "npx jetify && patch-package",
    "android": "npm run android:debug",
    "android:debug": "react-native run-android --variant=debug --appId=com.valar.pintu.debug",
    "android:staging": "react-native run-android --variant=releaseStaging --appId=com.valar.pintu.staging",
    "android:release": "react-native run-android --variant=release --appId=com.valar.pintu",
    "compile": "tsc -b --incremental",
    "ios": "react-native run-ios",
    "lint": "eslint modules --ext .js,.jsx,.ts,.tsx --quiet --fix",
    "start": "react-native start",
    "studio": "studio android",
    "test": "jest",
    "test:e2e": "detox test",
    "xcode": "open ios/Pintu.xcworkspace",
    "eslint": "yarn eslint . --ext .js,.jsx,.ts,.tsx",
    "sync-i18n": "ts-node modules/src/shared/libs/i18n/sync/gdrive/sync.ts",
    "gen:style": "npx ts-node modules/src/shared/utils/styles/generateStylesType.tsx"
  },
  "rnpm": {
    "assets": [
      "./modules/src/assets"
    ]
  },
  "dependencies": {
    "@apollo/react-hooks": "^3.1.3",
    "@codler/react-native-keyboard-aware-scroll-view": "^1.0.1",
    "@gurukumparan/react-native-android-inapp-updates": "^1.0.20",
    "@invertase/react-native-apple-authentication": "^2.0.0",
    "@nozbe/watermelondb": "^0.21.0",
    "@nozbe/with-observables": "^1.3.0",
    "@react-native-community/art": "^1.2.0",
    "@react-native-community/async-storage": "^1.8.1",
    "@react-native-community/clipboard": "^1.2.3",
    "@react-native-community/hooks": "^2.6.0",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/netinfo": "^5.5.1",
    "@react-native-community/push-notification-ios": "^1.3.0",
    "@react-native-firebase/analytics": "^11.5.0",
    "@react-native-firebase/app": "^11.5.0",
    "@react-native-firebase/crashlytics": "^11.5.0",
    "@react-native-firebase/dynamic-links": "^11.5.0",
    "@react-native-firebase/firestore": "^11.5.0",
    "@react-native-firebase/in-app-messaging": "^11.5.0",
    "@react-native-firebase/messaging": "^11.5.0",
    "@react-native-firebase/perf": "^11.5.0",
    "@react-native-firebase/remote-config": "^11.5.0",
    "@react-native-google-signin/google-signin": "^6.0.0",
    "@react-navigation/bottom-tabs": "^5.11.11",
    "@react-navigation/compat": "^5.3.15",
    "@react-navigation/native": "^5.9.3",
    "@react-navigation/stack": "^5.14.5",
    "@sentry/react-native": "^2.4.0",
    "@sentry/types": "^5.13.2",
    "@types/base-64": "^0.1.3",
    "@types/faker": "^4.1.10",
    "@types/gapi": "^0.0.39",
    "@types/jest": "^26.0.23",
    "@types/lodash": "^4.14.149",
    "@types/nanoid": "^2.1.0",
    "@types/qs": "^6.9.1",
    "@types/react-native": "^0.63",
    "@types/react-native-charts-wrapper": "^0.5.0",
    "@types/react-native-draggable-flatlist": "^1.1.1",
    "@types/react-native-fbsdk": "^1.1.0",
    "@types/react-native-modal-dropdown": "^0.6.1",
    "@types/react-native-share": "^3.0.0",
    "@types/react-native-vector-icons": "^6.4.5",
    "@types/react-qr-reader": "^2.1.2",
    "@types/semver": "^7.3.4",
    "@types/sprintf-js": "^1.1.2",
    "@types/styled-components": "^5.1.8",
    "@types/tinycolor2": "^1.4.2",
    "@types/ua-parser-js": "^0.7.33",
    "@typescript-eslint/eslint-plugin": "^2.22.0",
    "@typescript-eslint/parser": "^2.22.0",
    "@use-it/interval": "^0.1.3",
    "amplitude-js": "^5.9.0",
    "apollo-boost": "^0.4.7",
    "axios": "^0.21.1",
    "babel-plugin-styled-components": "^1.12.0",
    "babel-plugin-transform-remove-console": "^6.9.4",
    "base-64": "^0.1.0",
    "bignumber.js": "^9.0.0",
    "buffer": "^5.4.3",
    "dataloader": "^2.0.0",
    "date-fns": "^2.10.0",
    "dd-sdk-reactnative": "^1.0.0-beta1",
    "detox": "^18.13.0",
    "expo-barcode-scanner": "^10.0.0",
    "expo-calendar": "^9.0.0",
    "expo-haptics": "^9.0.0",
    "expo-image-manipulator": "^9.0.0",
    "expo-image-picker": "^10.0.0",
    "expo-linear-gradient": "^9.0.0",
    "expo-localization": "^10.0.0",
    "expo-notifications": "^0.9.0",
    "expo-permissions": "^11.0.0",
    "expo-screen-capture": "^3.0.0",
    "expo-secure-store": "^10.0.0",
    "final-form": "^4.18.5",
    "googleapis": "^71.0.0",
    "graphql": "^14.6.0",
    "i18next-scanner": "^2.10.3",
    "i18next-scanner-typescript": "^1.0.3",
    "jail-monkey": "^2.3.3",
    "js-sha3": "^0.8.0",
    "libphonenumber-js": "^1.7.46",
    "lodash": "^4.17.19",
    "lottie-react-native": "^3.5.0",
    "nanoid": "^2.1.7",
    "patch-package": "^6.2.2",
    "prettier": "^1.19.1",
    "qs": "^6.9.1",
    "react": "16.13.1",
    "react-async": "^10.0.0",
    "react-final-form": "6.3.3",
    "react-ga": "^2.7.0",
    "react-i18next": "^11.3.3",
    "react-is": "^16.8",
    "react-native": "0.63.2",
    "react-native-animatable": "^1.3.3",
    "react-native-appsflyer": "^6.2.41",
    "react-native-autoheight-webview": "^1.5.8",
    "react-native-camera": "^3.43.6",
    "react-native-charts-wrapper": "^0.5.7",
    "react-native-code-push": "^7.0.1",
    "react-native-confirmation-code-field": "^7.0.1",
    "react-native-date-picker": "^3.2.0",
    "react-native-device-info": "^5.6.1",
    "react-native-dots-pagination": "^0.2.0",
    "react-native-draggable-flatlist": "^2.5.2",
    "react-native-dropdown-picker": "^3.6.8",
    "react-native-email": "^1.0.2",
    "react-native-email-link": "^1.7.2",
    "react-native-exception-handler": "^2.10.8",
    "react-native-exit-app": "^1.1.0",
    "react-native-fast-image": "^8.1.4",
    "react-native-fbsdk-next": "^4.2.0",
    "react-native-fingerprint-scanner": "^6.0.0",
    "react-native-freshchat-sdk": "^3.3.0",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-markdown-display": "^6.0.1",
    "react-native-modal": "^11.5.4",
    "react-native-modals": "^0.22.3",
    "react-native-moengage": "^7.0.0",
    "react-native-permissions": "^3.0.3",
    "react-native-qrcode-svg": "^6.0.1",
    "react-native-rating-requestor": "^4.0.1",
    "react-native-reanimated": "^2.1.0",
    "react-native-restart": "^0.0.14",
    "react-native-rsa-native": "^1.1.4",
    "react-native-safe-area-context": "^3.2.0",
    "react-native-safe-area-view": "^1.0.0",
    "react-native-screens": "^3.2.0",
    "react-native-share": "^4.0.0",
    "react-native-splash-screen": "^3.2.0",
    "react-native-status-bar-height": "^2.4.0",
    "react-native-store-review": "^0.1.5",
    "react-native-svg": "^12.1.0",
    "react-native-swipe-list-view": "^3.2.3",
    "react-native-tab-view": "^2.13.0",
    "react-native-unimodules": "^0.12.0",
    "react-native-user-agent": "^2.1.0",
    "react-native-vector-icons": "^7.1.0",
    "react-native-view-shot": "^3.1.2",
    "react-native-webview": "^11.0.0",
    "react-native-youtube": "^2.0.1",
    "react-qr-reader": "^2.2.1",
    "react-query": "^3.13.3",
    "reactotron-react-native": "^4.0.3",
    "rn-placeholder": "^3.0.0",
    "semver": "^7.3.2",
    "slugify": "^1.4.0",
    "sprintf-js": "^1.1.2",
    "styled-components": "^5.2.1",
    "tinycolor2": "^1.4.1",
    "ts-node": "^8.6.2",
    "typescript": "^3.8.3",
    "url": "^0.11.0",
    "use-debounce": "^3.4.2",
    "wallet-address-validator": "https://github.com/pintu-crypto/wallet-address-validator.git"
  },
  "devDependencies": {
    "@babel/core": "^7.8.4",
    "@babel/plugin-proposal-decorators": "^7.13.15",
    "@babel/runtime": "^7.8.4",
    "@react-native-community/eslint-config": "^1.1.0",
    "@testing-library/react-hooks": "^5.1.2",
    "@testing-library/react-native": "^7.2.0",
    "@types/detox": "^17.14.0",
    "@types/nock": "^11.1.0",
    "@types/react-native-modals": "^0.19.0",
    "@types/react-test-renderer": "^17.0.1",
    "@types/testing-library__react-hooks": "^4.0.0",
    "babel-jest": "^26.6.3",
    "detox-recorder": "^1.0.151",
    "eslint": "^6.8.0",
    "eslint-plugin-prettier": "^3.1.2",
    "faker": "^5.5.3",
    "jest": "^26.6.3",
    "jest-circus": "^26.6.3",
    "jetifier": "^1.6.4",
    "md5": "^2.3.0",
    "metro-react-native-babel-preset": "^0.59.0",
    "nock": "^13.0.11",
    "react-native-flipper": "^0.86.0",
    "react-native-flipper-databases": "^0.2.1",
    "react-test-renderer": "16.13.1",
    "ts-jest": "^26.5.5",
    "ts-retry-promise": "^0.6.0"
  },
  "detox": {
    "configurations": {
      "ios.sim.debug": {
        "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/Pintu Debug.app",
        "build": "xcodebuild -workspace  ios/apps.xcworkspace -scheme apps -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
        "type": "ios.simulator",
        "device": {
          "type": "iPhone 11 Pro"
        }
      }
    },
    "test-runner": "jest"
  }
}

Question: Minimum iOS platform

Is your feature request related to a problem? Please describe.

In our app, we are using 10 as minimum iOS version in our Podfile, but your bridge needs iOS 11 as minimum version.
If it's not required for your native SDK, can you downgrade to the minimum version you need (ie: 9 or 10) ?

[!] The platform of the target App (iOS 10.0) may not be compatible with DatadogSDK (1.5.1) which has a minimum requirement of iOS 11.0.

Describe the solution you'd like

Being able to use the RN bridge with minimum version to 10.

Additional context

Version: 1.0.0-alpha3

Warning: cycle dependencies

Describe what happened

Require cycle: node_modules/dd-sdk-reactnative/src/index.tsx -> node_modules/dd-sdk-reactnative/src/DdSdkReactNative.tsx -> node_modules/dd-sdk-reactnative/src/rum/instrumentation/DdRumUserInteractionTracking.tsx -> node_modules/dd-sdk-reactnative/src/rum/instrumentation/DdEventsInterceptor.tsx -> node_modules/dd-sdk-reactnative/src/index.tsx

Steps to reproduce the issue:

npm install [email protected]
npx react-native run-android
adb logcat or look at the console using debugger

Describe what you expected:

Additional context
- Version of the bridge: 1.0.0-alpha3
- Version of Android SDK:

[...]
|    +--- com.datadoghq:dd-sdk-android:1.8.0-alpha1
|    |    +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.3.61
|    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.61 -> 1.4.21 (*)
|    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.0 -> 1.4.21 (*)
|    |    +--- com.squareup.okhttp3:okhttp:3.12.6 -> 3.14.1 (*)
|    |    +--- com.google.code.gson:gson:2.8.6
|    |    +--- com.lyft.kronos:kronos-android:0.0.1-alpha10
|    |    |    +--- com.lyft.kronos:kronos-java:0.0.1-alpha10
|    |    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 -> 1.4.21 (*)
|    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.10 -> 1.4.21 (*)
|    |    +--- androidx.core:core:1.3.1 (*)
|    |    +--- androidx.navigation:navigation-fragment:2.3.0
|    |    |    +--- androidx.fragment:fragment:1.2.4 (*)
|    |    |    \--- androidx.navigation:navigation-runtime:2.3.0
|    |    |         +--- androidx.navigation:navigation-common:2.3.0
|    |    |         |    +--- androidx.annotation:annotation:1.1.0
|    |    |         |    +--- androidx.core:core:1.1.0 -> 1.3.1 (*)
|    |    |         |    \--- androidx.collection:collection:1.1.0 (*)
|    |    |         +--- androidx.activity:activity:1.1.0 (*)
|    |    |         +--- androidx.lifecycle:lifecycle-viewmodel:2.2.0 (*)
|    |    |         +--- androidx.savedstate:savedstate:1.0.0 (*)
|    |    |         \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.2.0 (*)
|    |    +--- androidx.navigation:navigation-runtime-ktx:2.3.0
|    |    |    +--- androidx.navigation:navigation-runtime:2.3.0 (*)
|    |    |    +--- androidx.navigation:navigation-common-ktx:2.3.0
|    |    |    |    +--- androidx.navigation:navigation-common:2.3.0 (*)
|    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.71 -> 1.4.21 (*)
|    |    |    |    +--- androidx.core:core-ktx:1.1.0
|    |    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.31 -> 1.4.21 (*)
|    |    |    |    |    +--- androidx.annotation:annotation:1.1.0
|    |    |    |    |    \--- androidx.core:core:1.1.0 -> 1.3.1 (*)
|    |    |    |    \--- androidx.collection:collection:1.1.0 (*)
|    |    |    +--- androidx.activity:activity-ktx:1.1.0
|    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.4.21 (*)
|    |    |    |    +--- androidx.activity:activity:[1.1.0] -> 1.1.0 (*)
|    |    |    |    +--- androidx.core:core-ktx:1.1.0 (*)
|    |    |    |    +--- androidx.lifecycle:lifecycle-runtime-ktx:2.2.0
|    |    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.4.21 (*)
|    |    |    |    |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0
|    |    |    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.4.21 (*)
|    |    |    |    |    |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0
|    |    |    |    |    |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.4.21 (*)
|    |    |    |    |    |         \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.50 -> 1.4.21
|    |    |    |    |    +--- androidx.lifecycle:lifecycle-runtime:2.2.0 (*)
|    |    |    |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |    |    |    \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0
|    |    |    |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.4.21 (*)
|    |    |    |         +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0 (*)
|    |    |    |         \--- androidx.lifecycle:lifecycle-viewmodel:2.2.0 (*)
|    |    |    +--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0 (*)
|    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.71 -> 1.4.21 (*)
|    |    +--- androidx.recyclerview:recyclerview:1.1.0 (*)
|    |    +--- androidx.work:work-runtime:2.4.0
|    |    |    +--- com.google.guava:listenablefuture:1.0
|    |    |    +--- androidx.lifecycle:lifecycle-livedata:2.1.0 (*)
|    |    |    +--- androidx.room:room-runtime:2.2.5
|    |    |    |    +--- androidx.room:room-common:[2.2.5] -> 2.2.5
|    |    |    |    |    \--- androidx.annotation:annotation:1.1.0
|    |    |    |    +--- androidx.sqlite:sqlite-framework:2.0.1 -> 2.1.0 (*)
|    |    |    |    +--- androidx.sqlite:sqlite:2.0.1 -> 2.1.0 (*)
|    |    |    |    \--- androidx.arch.core:core-runtime:2.0.1 -> 2.1.0 (*)
|    |    |    +--- androidx.sqlite:sqlite:2.1.0 (*)
|    |    |    +--- androidx.sqlite:sqlite-framework:2.1.0 (*)
|    |    |    +--- androidx.core:core:1.1.0 -> 1.3.1 (*)
|    |    |    \--- androidx.lifecycle:lifecycle-service:2.1.0
|    |    |         \--- androidx.lifecycle:lifecycle-runtime:2.1.0 -> 2.2.0 (*)
|    |    +--- io.opentracing:opentracing-api:0.32.0
|    |    +--- io.opentracing:opentracing-noop:0.32.0
|    |    |    \--- io.opentracing:opentracing-api:0.32.0
|    |    \--- io.opentracing:opentracing-util:0.32.0
|    |         +--- io.opentracing:opentracing-api:0.32.0
|    |         \--- io.opentracing:opentracing-noop:0.32.0 (*)
|    +--- com.datadoghq:dd-bridge-android:0.2.0
|    |    +--- org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.3.61 (*)
|    |    +--- com.datadoghq:dd-sdk-android:1.8.0-alpha1 (*)
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.0 -> 1.4.21 (*)
|    +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.21 (*)
|    \--- com.github.xgouchet.Elmyr:core:1.2.0
|         \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.61 -> 1.4.21 (*)
- Version of iOS SDK:
PODS:
  [...]
  - DatadogSDK (1.5.1):
    - Kronos (~> 4.1)
  - DatadogSDKBridge (0.2.0):
    - DatadogSDK (~> 1.5.1)
  - dd-sdk-reactnative (1.0.0-alpha3):
    - DatadogSDKBridge (~> 0.2.0)
    - React
  - Kronos (4.2.1)
  - React (0.62.2)
- A copy of your `package.json` file
{
  "dependencies": {
    [...]
    "@react-navigation/bottom-tabs": "^5.11.7",
    "@react-navigation/native": "^5.9.2",
    "@react-navigation/stack": "^5.14.2",
    "dd-sdk-reactnative": "1.0.0-alpha3",
    "react": "16.11.0",
    "react-native": "0.62.2",
  },
  "engines": {
    "node": "12"
  }
}

stopResource introduces `size` argument - should update documentation

Ref:

stopResource(key: string, statusCode: number, kind: string, size: number = -1, context: object = {}, timestampMs: number = Date.now()): Promise<void> {

The stopResource function was updated with the size parameter, which has not been updated in the documentation.
In the implementation details for swift/kotlin and native bridge reflect the updated argument.


Would like to get the authors comments on what size parameter does, I can add a PR for updating documentation and tests afterward.

All errors are tracked and logged even with `trackErrors` turned off

Describe what happened
While trying to add support for ignoring certain errors, I noticed that even if trackErrors is set to false in the config, all errors are sent to DD.

// config
if (enableRUM) {
      this.config = new DdSdkReactNativeConfiguration(
        clientToken,
        env,
        appId,
        trackActions, // track User interactions (e.g.: Tap on buttons)
        trackResources, // track XHR Resources
        false, // track Errors
      )

      this.config.nativeCrashReportEnabled = false
      this.config.sampleRate = sampleRate
}

Error on DD:
image

Steps to reproduce the issue:

  • Set trackErrors as false
  • Trigger an error
  • Error is reported in DD logs

Describe what you expected:

  • If trackErrors are turned off, errors shouldn't appear in DD unless explicitly triggered via addError helper

Additional context
- "@datadog/mobile-react-native": "1.0.0-rc4",
- "@datadog/mobile-react-navigation": "1.0.0-rc4",

Issue with `react-native-navigation` not resolved when upgrading from beta1 to beta2

Describe what happened

Hey DataDog ! Hope you're all doing well :)

We encountered an issue today when updating dd-sdk-reactnative so I wanted to make sure to share it, as well as a possible fix for it.

We make use of @react-navigation/native in our project and I saw you recently added support for wix/react-native-navigation which is great! The issue here is that metro tries to resolve react-native-navigation even we don't have it in our dependencies. I feel its because module index exports the DdRumReactNativeNavigationTracking which leads Metro to resolve the imports in there.

I guess people using it the other way around would get a pretty similar issue just with @react-navigation/native not being resolvable ^^

Here's the error:

13:48:27
  If you are sure the module exists, try these steps:
13:48:27
   1. Clear watchman watches: watchman watch-del-all
13:48:27
   2. Delete node_modules and run yarn install
13:48:27
   3. Reset Metro's cache: yarn start --reset-cache
13:48:27
   4. Remove the cache: rm -rf /tmp/metro-*
13:48:27
     6 | 
13:48:27
     7 | import React from 'react'
13:48:27
  >  8 | import { ComponentDidAppearEvent, Navigation } from 'react-native-navigation'; // <---- THIS
13:48:27
     9 | import { DdRum } from '../../foundation';
13:48:27
    10 | /**.
13:48:27
      at ModuleResolver.resolveDependency (/Users/[snipped]/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:234:15)
13:48:27
      at DependencyGraph.resolveDependency (/Users/[snipped]/node_modules/metro/src/node-haste/DependencyGraph.js:413:43)
13:48:27
      at Object.resolve (/Users/[snipped]/node_modules/metro/src/lib/transformHelpers.js:317:42)
13:48:27
      at resolve (/Users/[snipped]/node_modules/metro/src/DeltaBundler/traverseDependencies.js:629:33)
13:48:27
      at /Users/[snipped]/node_modules/metro/src/DeltaBundler/traverseDependencies.js:645:26
13:48:27
      at Array.reduce (<anonymous>)
13:48:27
      at resolveDependencies (/Users/[snipped]/node_modules/metro/src/DeltaBundler/traverseDependencies.js:644:33)
13:48:27
      at /Users/[snipped]/node_modules/metro/src/DeltaBundler/traverseDependencies.js:329:33
13:48:27
      at Generator.next (<anonymous>)
13:48:27
      at asyncGeneratorStep (/Users/[snipped]
/node_modules/metro/src/DeltaBundler/traverseDependencies.js:137:24)
13:48:27
  info Run CLI with --verbose flag for more details.
13:49:46
  Process exited with code 1 (Step: Create React native bundle for Android (Command Line))
13:48:27
  Step Create React native bundle for Android (Command Line) failed

Steps to reproduce the issue:

  1. Setup a project with dd-sdk-reactnative @ 1.0.0-beta1
  2. Update to 1.0.0-beta2
  3. Try to compile the iOS app, results in this

Describe what you expected:

I except the app to just compile as it was before ^^

Temporary fix

In local, removing the export for the module we don't use makes metro happy

Additional context
- Version of the SDK: 1.0.0-beta2
- A copy of your package.json file: Can't do that ^^

RUM Actions are not logged shortly after SDK initialization

Describe what happened
For a short period after the SDK is initialized, RUM Actions logged with DdRum.addAction() do not appear in the Datadog RUM session

Steps to reproduce the issue:

await DdSdkReactNative.initialize(new DdSdkReactNativeConfiguration(...))
DdSdkReactNative.setUser(...)
DdRum.addAction(...)

Describe what you expected:

  1. The SDK is fully initialized and ready to log RUM Actions directly after the Promise returned by DdSdkReactNative.initialize() fulfills, or
  2. RUM Actions logged while the SDK has not finished initializing are not silently dropped

Additional context

    "@datadog/mobile-react-native": "1.0.0-rc4",
    "@datadog/mobile-react-navigation": "1.0.0-rc4",
    "@react-navigation/native": "5.9.8",
  • DdRumReactNavigationTracking.startTrackingViews() is used per docs

does the library come with Offline mode support?

Thanks for taking the time for reporting an issue!

Describe what happened
does the datadog/mobile-react-native come with Offline mode support?

we are debugging crashes related to calling datadog when not connected

Steps to reproduce the issue:
Load app, make a call to datadog while offline.

Describe what you expected:
App load as expected.

Additional context
- Version of the SDK
- A copy of your package.json file

Peer dependency error

I can't install library

Below Error Code

npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"17.0.1" from the root project
npm ERR!   peer react@"*" from @react-navigation/[email protected]
npm ERR!   node_modules/@react-navigation/native
npm ERR!     @react-navigation/native@"^5.9.4" from the root project
npm ERR!     peer @react-navigation/native@"^5.6.0" from [email protected]
npm ERR!     node_modules/dd-sdk-reactnative
npm ERR!       dd-sdk-reactnative@"*" from the root project
npm ERR!   1 more (react-native)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.13.1" from [email protected]
npm ERR! node_modules/dd-sdk-reactnative
npm ERR!   dd-sdk-reactnative@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/hongsa/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/hongsa/.npm/_logs/2021-07-22T02_38_52_419Z-debug.log

My react-native version is 0.64.1

RUM Events not showing in Play Store build

I am having a strange issue where RUM seems to work brilliantly in all environments except production.

My app is android only at the moment.

Building my code locally (debug build) and running on emulator works perfectly for both RUM & Logs.
Next I tried creating a release build and shipping it to Firebase App Distribution and installing in on a physical phone; both RUM and Logs also work great.
Then I create a release and send it to Google Play, and in that build RUM does not work. Logs do work still.
I have tried both manual view creation and tracking the NavigationContainer, but I can't get the build that goes to Google Play to work.

I have set the sample rate to 100 so as to not miss anything as well.

Would anyone have any idea what could be causing this?

Here is my package.json

"dependencies": {
    "@apollo/client": "^3.3.16",
    "@datadog/mobile-react-native": "^1.0.0-rc4",
    "@datadog/mobile-react-navigation": "^1.0.0-rc4",
    "@fortawesome/fontawesome-svg-core": "^1.2.35",
    "@fortawesome/free-regular-svg-icons": "^5.15.3",
    "@fortawesome/free-solid-svg-icons": "^5.15.3",
    "@fortawesome/pro-regular-svg-icons": "^5.15.3",
    "@fortawesome/pro-solid-svg-icons": "^5.15.3",
    "@fortawesome/react-native-fontawesome": "^0.2.6",
    "@react-native-async-storage/async-storage": "^1.15.9",
    "@react-native-community/datetimepicker": "^3.4.7",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-community/netinfo": "^6.0.0",
    "@react-native-firebase/app": "^14.2.2",
    "@react-native-firebase/crashlytics": "^14.2.2",
    "@react-native-firebase/messaging": "^14.2.2",
    "@react-native-firebase/perf": "^14.2.2",
    "@react-native-firebase/remote-config": "^14.2.2",
    "@react-navigation/bottom-tabs": "^5.11.10",
    "@react-navigation/drawer": "^5.12.5",
    "@react-navigation/native": "^6.0.2",
    "@react-navigation/stack": "^5.14.5",
    "@reduxjs/toolkit": "^1.6.0",
    "@segment/analytics-react-native": "^1.4.8",
    "@types/ms": "^0.7.31",
    "@types/react-native-snap-carousel": "^3.8.3",
    "@types/styled-components": "^5.1.14",
    "@types/styled-components-react-native": "^5.1.1",
    "compare-versions": "3.6.0",
    "cross-fetch": "^3.1.4",
    "date-fns": "2.21.3",
    "expo-secure-store": "^10.1.0",
    "graphql": "^15.5.0",
    "graphql-request": "^3.4.0",
    "lodash": "^4.17.21",
    "ms": "^2.1.3",
    "react": "17.0.2",
    "react-native": "0.66.4",
    "react-native-animated-pagination-dot": "^0.1.8",
    "react-native-app-auth": "6.4.0",
    "react-native-appstate-hook": "^1.0.5",
    "react-native-config": "^1.4.2",
    "react-native-device-info": "8.1.3",
    "react-native-dropdown-picker": "^5.1.28",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-push-notification": "^7.4.0",
    "react-native-reanimated": "^2.3.1",
    "react-native-safe-area-context": "^3.2.0",
    "react-native-screens": "^3.2.0",
    "react-native-snap-carousel": "^3.9.1",
    "react-native-splash-screen": "^3.2.0",
    "react-native-svg": "^12.1.1",
    "react-native-svg-charts": "^5.4.0",
    "react-native-unimodules": "^0.14.10",
    "react-native-uuid": "^2.0.1",
    "react-redux": "^7.2.4",
    "styled-components": "^5.3.1"

Getting `helperSkipTransparentExpressionWrappers.skipTransparentExprWrapperNodes is not a function`

Thanks for taking the time for reporting an issue!

Describe what happened
I'm upgrading from 1.0.0-rc2 to 1.0.0-rc4. I tried 1.0.0-rc3, but facing the same errors.

DD Package versions:

    "@datadog/mobile-react-native": "1.0.0-rc3",
    "@datadog/mobile-react-navigation": "1.0.0-rc3",

I tried installing @babel/helper-skip-transparent-expression-wrappers as a dev dependency to try solve it, but didn't work.

Reverting back to 1.0.0-rc2 works well.

Steps to reproduce the issue:
Podfile has below part:

dynamic_frameworks = [['DatadogSDK','DatadogSDKObjc','Kronos'], ...].flatten

target 'app' do
  ...
  pre_install do |installer|
    installer.pod_targets.each do |pod|
      if !dynamic_frameworks.include?(pod.name)
        def pod.static_framework?;
          true
        end
        def pod.build_type;
          Pod::BuildType.static_library
        end
      end
    end
  end
  ...
  1. Upgrade to 1.0.0-rc3 or 4 for both mobile-react-native and mobile-react-navigation. (I'm using react-navigation).
  2. Pod install
  3. Run app

Describe what you expected:
No errors.

Additional context
- Version of the SDK - 1.0.0-rc3 and 1.0.0-rc4
- A copy of your package.json file - N/A

Apply iOS 15 crash fix to react native package?

Is your feature request related to a problem? Please describe.
I am in the process of integrating the DataDog react native package, which includes DataDogSDKBridge 0.5.0 as a dependency (https://github.com/DataDog/dd-sdk-reactnative/blob/main/packages/core/DatadogSDKReactNative.podspec#L20), which in turn relies on DataDog iOS SDK 1.8.0-beta.1 (https://github.com/DataDog/dd-bridge-ios/blob/main/DatadogSDKBridge.podspec#L20).

DataDog iOS SDK 1.7.2 included a fix for an iOS 15 crash (DataDog/dd-sdk-ios@5db35ab). We are hesitant about shipping code that could potentially crash. Any chance of getting the fix into the 1.8.x branch that ships with the react native package? Thanks!

Describe the solution you'd like
Update the react native package with the iOS 15 crash fix.

Describe alternatives you've considered
Forking all packages and applying the fix myself

setAttributes is not adding any attributes to the logs

Describe what happened
looks like calling setAttributes does not have any effect on logs and these attributes are not appended to the logs.

Steps to reproduce the issue:

Describe what you expected:
We are calling setAttributes with some global data which should appear in all logs logged after that point forward

Additional context
- Version of the SDK: "dd-sdk-reactnative": "1.0.0-beta3",

nativeCrashReportEnabled option is not working

Describe what happened
Crashes are not appear in the UX Monitoring -> RUM Applications -> Total Crashes by Version section when nativeCrashReportEnabled option is enabled.

Steps to reproduce the issue:
Set up Datadog using config

const config = new DdSdkReactNativeConfiguration(
  'REMOVED',
  __DEV__ ? 'dev' : 'prod',
  'REMOVED',
  true, // track User interactions (e.g.: Tap on buttons)
  true, // track XHR Resources
  true, // track Errors
);
config.nativeCrashReportEnabled = true;
DdSdkReactNative.initialize(config);

Crash app using IOS native code.
Example

NSMutableArray *tmp = [[NSMutableArray alloc] init];
NSObject *object = nil;
[tmp addObject:object];

Describe what you expected:
Crashes should appear in the Total Crashes by Version section.

Additional context
Version of the SDK - "dd-sdk-reactnative": "^1.0.0-beta3"

[Feature Request] Add support for Expo Config Plugins

I am on a team that's fixin to start work on a cross-platform Expo app, intended to replace our three legacy clients. Wanted to inquire whether y'all would consider adding support for Config Plugins, so this library can be used with the Expo Managed Workflow (i.e. without ejecting)

Thanks for your consideration!

Feature Context

Over the past several months Expo has introduced features which enable apps to use external native modules, without ejecting Expo's managed workflow.

The customizations to the iOS and Android code that are required by a given native module are automated, using an AST-based API that Expo provides through "Config Plugins" feature.

These automations (called "mods") are executed during a new "Prebuild" phase, in which boilerplate ios and android directories are created — and then their respective files are altered, based on the instructions in a given modules config plugin. The end result is essentially the same as if you ejected and manually changed the ios/android files.

Here's the Expo blog post announcing Config Plugins and the associated feature-set.

Overview of Proposed Implementation

The process for creating a Config Plugin is detailed here:
https://docs.expo.io/guides/config-plugins/#creating-a-plugin

There are a few different "recipes" for how to implement — but the gist of it is:

  • Create the app.plugin.js file, at the project root — which serves as a standard entrypoint where expo can resolve the plugin code. [ex: expo-camera]
  • Export a function prefixed using "with" (eg withFeature) which accepts a config object that can be used, along with @expo/config-plugins methods, to implement mods for each platform's native code. [ex: withCamera]
  • Add mods corresponding to the setup steps in your README.md
  • Celebrate!

Feature Request: React 17 Support

Describe the solution you'd like
We would like to use this in our project that has upgraded to React 17. Is this being considered for the public release?

Additional context
I was able to upgrade to v17.0.1 with passing tests. However, I had to keep react-test-renderer at ^16.13.1 due to this issue: react-navigation/react-navigation#9023

SyntaxError: Unexpected identifier '_mobileReactNative'

Hello everyone, I just started using Datadog for my React-Native application, but after initializing, I got this error:

SyntaxError: Unexpected identifier '_mobileReactNative'

I can see there is a difference between React-Native versions, because my project has 0.63.3 and Datadog has 0.63.4.

I installed this library using npm install ... --force

Did anyone faced this issue before?

User is overwritten in session, when a different user, logs in on the same device

Describe what happened
Login as User A, [calls DdSdkReactNative.setUser({}) ]
Logout.
Login as User B, [calls DdSdkReactNative.setUser({}) ]

When I view the above session, all activity logged while User A was logged in, is kept in the same session as User B's activity.
Steps to reproduce the issue:
Login as a user A
Wait a few seconds/do a few things
Logout user A
Login as user B

check the logs
The entire session displayed, belongs to user B

Describe what you expected:
I expect a new session to be started when User B logs in (since SetUser is called, maybe check if another user is already assigned the session)

Is this standard behaviour ?
Is there a workaround for this ?

Additional context
- Version of the SDK: "1.0.0-beta1"
- A copy of your package.json file

Remove user that was previously set

Describe what happened
Looking to remove a user, similar to datadogRum.removeUser() in @datadog/browser-rum. Couldn't find a way at the moment unless using setUser to set to another user.

Steps to reproduce the issue:

  1. Set user
DdSdkReactNative.setUser({
    id,
    email,
    name,
});
  1. Trying to remove user on logout

Describe what you expected:
A removeUser API function or way to remove a user. What is the recommended approach?

Additional context
- "@datadog/mobile-react-native": "^1.0.0-rc4"

EDIT:
Apologies if this shouldn't be labeled as a bug

[Help] Action Type

How Can I Add Action Name?

스크린샷 2021-07-22 오후 5 12 07
In this screenshot, all action name is same.

DdRum.addAction('CLICK', 'print_receipt', Date.now(), {});
addAction is also not working.

And how to use accessibilityLabel?

And I want react native data dog documentaion

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.