Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rn-app-with-native/.ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.6
3.2.2
6 changes: 5 additions & 1 deletion rn-app-with-native/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,11 @@ dependencies {
implementation("com.squareup.okhttp3:okhttp:4.10.0")

// The version is set by @datadog/mobile-react-native
implementation "com.datadoghq:dd-sdk-android"
implementation "com.datadoghq:dd-sdk-android-rum:2.11.0"
implementation "com.datadoghq:dd-sdk-android-logs:2.11.0"
implementation "com.datadoghq:dd-sdk-android-trace:2.11.0"
implementation "com.datadoghq:dd-sdk-android-webview:2.11.0"
implementation "com.datadoghq:dd-sdk-android-okhttp:2.11.0"
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import android.view.View
import android.widget.Button
import androidx.fragment.app.Fragment
import androidx.navigation.fragment.findNavController
import com.datadog.android.DatadogInterceptor
import com.datadog.android.rum.GlobalRum
import com.datadog.android.rum.GlobalRumMonitor
import com.datadog.android.okhttp.DatadogInterceptor
import okhttp3.OkHttpClient
import okhttp3.Request
import java.io.IOException
Expand All @@ -28,12 +28,12 @@ class FirstFragment : Fragment(R.layout.fragment_first) {

override fun onResume() {
super.onResume()
GlobalRum.get().startView("first_fragment", "First Fragment", mapOf())
GlobalRumMonitor.get().startView("first_fragment", "First Fragment", mapOf())
}

override fun onPause() {
super.onPause()
GlobalRum.get().stopView("first_fragment", mapOf())
GlobalRumMonitor.get().stopView("first_fragment", mapOf())
}

private fun onButtonPress() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.os.Bundle
import android.view.View
import android.widget.Button
import androidx.fragment.app.Fragment
import com.datadog.android.rum.GlobalRum
import com.datadog.android.rum.GlobalRumMonitor

class SecondFragment : Fragment(R.layout.fragment_second) {

Expand All @@ -20,12 +20,12 @@ class SecondFragment : Fragment(R.layout.fragment_second) {

override fun onResume() {
super.onResume()
GlobalRum.get().startView("second_fragment", "Second Fragment", mapOf())
GlobalRumMonitor.get().startView("second_fragment", "Second Fragment", mapOf())
}

override fun onPause() {
super.onPause()
GlobalRum.get().stopView("second_fragment", mapOf())
GlobalRumMonitor.get().stopView("second_fragment", mapOf())
}

private fun onCloseButtonPress() {
Expand Down
2 changes: 1 addition & 1 deletion rn-app-with-native/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 33
kotlin_version = "1.7.10"
kotlin_version = "1.8.22"

// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "23.1.7779620"
Expand Down
3 changes: 3 additions & 0 deletions rn-app-with-native/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ newArchEnabled=false
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true

# Kotlin Version
kotlinVersion=1.8.22
22 changes: 21 additions & 1 deletion rn-app-with-native/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ target 'ReactNativeWithIOSScreen' do
:app_path => "#{Pod::Config.instance.installation_root}/.."
)

pod 'DatadogSDKObjc', '~> 1.15.0'
pod 'DatadogSDKObjc', '~> 2.13.0'

target 'ReactNativeWithIOSScreenTests' do
inherit! :complete
Expand All @@ -58,5 +58,25 @@ target 'ReactNativeWithIOSScreen' do
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)

installer.pods_project.targets.each do |target|
# Workaround for https://github.com/facebook/react-native/issues/43335
# This avoids having to disable Flipper
if target.name == 'Flipper'
file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
contents = File.read(file_path)
unless contents.include?('#include <functional>')
File.open(file_path, 'w') do |file|
file.puts('#include <functional>')
file.puts(contents)
end
end
end

target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']
end
end
end
end
80 changes: 58 additions & 22 deletions rn-app-with-native/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,37 @@
PODS:
- boost (1.76.0)
- CocoaAsyncSocket (7.6.5)
- DatadogSDK (1.15.0)
- DatadogSDKCrashReporting (1.15.0):
- DatadogSDK (= 1.15.0)
- PLCrashReporter (~> 1.11.0)
- DatadogSDKObjc (1.15.0):
- DatadogSDK (= 1.15.0)
- DatadogSDKReactNative (1.4.0):
- DatadogSDK (~> 1.15.0)
- DatadogSDKCrashReporting (~> 1.15.0)
- DatadogCore (2.13.0):
- DatadogInternal (= 2.13.0)
- DatadogCrashReporting (2.13.0):
- DatadogInternal (= 2.13.0)
- PLCrashReporter (~> 1.11.2)
- DatadogInternal (2.13.0)
- DatadogLogs (2.13.0):
- DatadogInternal (= 2.13.0)
- DatadogRUM (2.13.0):
- DatadogInternal (= 2.13.0)
- DatadogSDKObjc (2.13.0):
- DatadogCore (= 2.13.0)
- DatadogLogs (= 2.13.0)
- DatadogRUM (= 2.13.0)
- DatadogSessionReplay (= 2.13.0)
- DatadogTrace (= 2.13.0)
- DatadogSDKReactNative (2.4.1):
- DatadogCore (~> 2.13.0)
- DatadogCrashReporting (~> 2.13.0)
- DatadogLogs (~> 2.13.0)
- DatadogRUM (~> 2.13.0)
- DatadogTrace (~> 2.13.0)
- DatadogWebViewTracking (~> 2.13.0)
- React-Core
- DatadogSessionReplay (2.13.0):
- DatadogInternal (= 2.13.0)
- DatadogTrace (2.13.0):
- DatadogInternal (= 2.13.0)
- OpenTelemetrySwiftApi (= 1.6.0)
- DatadogWebViewTracking (2.13.0):
- DatadogInternal (= 2.13.0)
- DoubleConversion (1.1.6)
- FBLazyVector (0.71.3)
- FBReactNativeSpec (0.71.3):
Expand Down Expand Up @@ -88,7 +109,8 @@ PODS:
- hermes-engine/Pre-built (0.71.3)
- libevent (2.1.12)
- OpenSSL-Universal (1.1.1100)
- PLCrashReporter (1.11.0)
- OpenTelemetrySwiftApi (1.6.0)
- PLCrashReporter (1.11.2)
- RCT-Folly (2021.07.22.00):
- boost
- DoubleConversion
Expand Down Expand Up @@ -435,14 +457,14 @@ PODS:
- RNScreens (3.20.0):
- React-Core
- React-RCTImage
- SocketRocket (0.6.0)
- SocketRocket (0.6.1)
- Yoga (1.14.0)
- YogaKit (1.18.1):
- Yoga (~> 1.14)

DEPENDENCIES:
- boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
- DatadogSDKObjc (~> 1.15.0)
- DatadogSDKObjc (~> 2.13.0)
- "DatadogSDKReactNative (from `../node_modules/@datadog/mobile-react-native`)"
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
Expand Down Expand Up @@ -509,9 +531,15 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- CocoaAsyncSocket
- DatadogSDK
- DatadogSDKCrashReporting
- DatadogCore
- DatadogCrashReporting
- DatadogInternal
- DatadogLogs
- DatadogRUM
- DatadogSDKObjc
- DatadogSessionReplay
- DatadogTrace
- DatadogWebViewTracking
- Flipper
- Flipper-Boost-iOSX
- Flipper-DoubleConversion
Expand All @@ -524,6 +552,7 @@ SPEC REPOS:
- fmt
- libevent
- OpenSSL-Universal
- OpenTelemetrySwiftApi
- PLCrashReporter
- SocketRocket
- YogaKit
Expand Down Expand Up @@ -609,10 +638,16 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
boost: 57d2868c099736d80fcd648bf211b4431e51a558
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DatadogSDK: d7e3ef65693db38842f85885c01ba0865e10a782
DatadogSDKCrashReporting: 4be11b3693ed048f461391f724788ea96d31633a
DatadogSDKObjc: e7e9ae85f2f15a37e9d404ae85726b1eda3a2f30
DatadogSDKReactNative: 6d1426209f448acbf58c13673b963a8b25cf00f5
DatadogCore: 9390fd07a89f57a23983de66fbec5bf3c2034f7a
DatadogCrashReporting: 79b67b790df186524fc76d45c0b8ce751c36ef41
DatadogInternal: 61ab12516d2faad79e35973534c29a72b0d44382
DatadogLogs: 912d7b3fd3d75df856de060082b785f92f7cefe6
DatadogRUM: b5629479d4553d80f2a57ef9db44ce37e56f8b97
DatadogSDKObjc: e644312016ed4914088b3fcfc1465507b276c2d1
DatadogSDKReactNative: 0101462ddda14f13470dfe05cca244c190bb1fac
DatadogSessionReplay: 2e7795c1a8a86ff989ed5c0ccd616eed0f6c9a3a
DatadogTrace: 1f40893de00c9a9b87be46fa7016fa0d50c4e66b
DatadogWebViewTracking: d1e2e755bb2ed7c18208471b9cbcfc7cb920aa45
DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
FBLazyVector: 60195509584153283780abdac5569feffb8f08cc
FBReactNativeSpec: 9c191fb58d06dc05ab5559a5505fc32139e9e4a2
Expand All @@ -630,7 +665,8 @@ SPEC CHECKSUMS:
hermes-engine: 38bfe887e456b33b697187570a08de33969f5db7
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
PLCrashReporter: 7a9dff14a23ba5d2e28c6160f0bb6fada5e71a8d
OpenTelemetrySwiftApi: 657da8071c2908caecce11548e006f779924ff9c
PLCrashReporter: 499c53b0104f95c302d94fd723ebb03c56d9bac8
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCTRequired: bec48f07daf7bcdc2655a0cde84e07d24d2a9e2a
RCTTypeSafety: 171394eebacf71e1cfad79dbfae7ee8fc16ca80a
Expand Down Expand Up @@ -661,10 +697,10 @@ SPEC CHECKSUMS:
React-runtimeexecutor: 7bf0dafc7b727d93c8cb94eb00a9d3753c446c3e
ReactCommon: 6f65ea5b7d84deb9e386f670dd11ce499ded7b40
RNScreens: 218801c16a2782546d30bd2026bb625c0302d70f
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: 5ed1699acbba8863755998a4245daa200ff3817b
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: c4e6a155e5b5401655aa91bd0d4205b06822961d
PODFILE CHECKSUM: ab112b00987953709ab0615fb336e43d6d586bae

COCOAPODS: 1.11.3
COCOAPODS: 1.15.2
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
Expand Down Expand Up @@ -661,7 +661,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ - (IBAction)goBack {
}

- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];

[DDGlobal.rum startViewWithViewController:self name:nil attributes:nil];
[super viewDidAppear:animated];
[[DDRUMMonitor shared] startViewWithViewController:self name:nil attributes:@{}];
}

- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];

[DDGlobal.rum stopViewWithViewController:self attributes:nil];
[super viewDidDisappear:animated];
[[DDRUMMonitor shared] stopViewWithViewController:self attributes:@{}];
}

@end
4 changes: 2 additions & 2 deletions rn-app-with-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"test": "jest"
},
"dependencies": {
"@datadog/mobile-react-native": "^1.4.0",
"@datadog/mobile-react-navigation": "^1.4.0",
"@datadog/mobile-react-native": "^2.4.1",
"@datadog/mobile-react-navigation": "^2.4.1",
"@react-navigation/native": "^6.1.4",
"@react-navigation/native-stack": "^6.9.10",
"react": "18.2.0",
Expand Down
6 changes: 6 additions & 0 deletions rn-app-with-native/src/CompletionDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ export const CompletionDetails = ({navigation}) => {
}}
title="Native long task"
/>
<Button
onPress={() => {
throw Error("Throw JS ERROR");
}}
title="Throw JS Error"
/>
</View>
);
};
16 changes: 8 additions & 8 deletions rn-app-with-native/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1064,15 +1064,15 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==

"@datadog/mobile-react-native@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@datadog/mobile-react-native/-/mobile-react-native-1.4.0.tgz#cd3d4af9edfe3b1bddff0871a825034e2c24d7fc"
integrity sha512-reeovnVHtz0SMtTxFrF2Th1l0pUhqZXRtmVvPzndSlp6KqGA9BccgNc36DLm/AhY30CEOa8bGVzzTw7KRAD6mA==
"@datadog/mobile-react-native@^2.4.1":
version "2.4.1"
resolved "https://registry.yarnpkg.com/@datadog/mobile-react-native/-/mobile-react-native-2.4.1.tgz#febcb7222d033564846cd75e6e3d843f2257f65b"
integrity sha512-k+W4dYvr23Lohn2NWY5OqBeNZIXXi4VX8cSg2i3W3rVEOaQtG5TEMSd7khQDcLUFipEkHVPRqjWg0j9QrC6dkg==

"@datadog/mobile-react-navigation@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@datadog/mobile-react-navigation/-/mobile-react-navigation-1.4.0.tgz#6da124c895f754c0cfb353f5031a1ef1ed164030"
integrity sha512-ZI7tjDoPWU9YcHG/1e14BrAi3YjvAEVZGGuD1IVC3K65sz3LIxy42+HJL/GbcnzuBsc/3slQVG0miR34FZ8qdA==
"@datadog/mobile-react-navigation@^2.4.1":
version "2.4.1"
resolved "https://registry.yarnpkg.com/@datadog/mobile-react-navigation/-/mobile-react-navigation-2.4.1.tgz#9cf6fa52584f0365ea90c419af6d4d5436862743"
integrity sha512-gd7ZKUAXT3MxXcXUE6UdttW3j8M0TwNWLHBzjkq+2lZHEdn+xq7EO5bus9MZQJFlKJZ7d6229lnBNdbd227+Cg==

"@eslint/eslintrc@^1.4.1":
version "1.4.1"
Expand Down