Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
313e844
useNativeInit Android implementation
antonis Mar 7, 2025
2e97acc
Adds changelog
antonis Mar 7, 2025
6eedaae
useNativeInit iOS implementation
antonis Mar 7, 2025
9ae5475
Fix indentation
antonis Mar 7, 2025
566550e
Extend test cases with realistic data
antonis Mar 7, 2025
770c9f4
Adds code sample in the changelog
antonis Mar 7, 2025
f8b37b5
Fix CHANGELOG.md
antonis Apr 4, 2025
d25db30
Warn if RESentySDK.init/start wasn't injected
antonis Apr 4, 2025
adc81a5
Make useNativeInit opt-in
antonis Apr 15, 2025
8c2cd73
Make Android failure warning more clear
antonis Apr 15, 2025
a2b5575
Make Android no update warning more clear
antonis Apr 15, 2025
5f4f7c5
Use path.basename to get last path component
antonis Apr 15, 2025
0431cc3
Update tests to account for the new warnings
antonis Apr 15, 2025
62d39cc
Explicitly check for kotlin
antonis Apr 16, 2025
235f3ef
Add filename in the warning message
antonis Apr 16, 2025
369cce7
Import only if init injection succeeds
antonis Apr 16, 2025
a53c7f4
Explicitly check for Objective-C
antonis Apr 16, 2025
5e4a98f
Add filename in the warning
antonis Apr 16, 2025
dce74b2
Make iOS file not found warning more clear
antonis Apr 16, 2025
0ffd26c
Import only if init injection succeeds
antonis Apr 16, 2025
744993c
Reset test mock config in a function
antonis Apr 16, 2025
5447be9
Lint issue
antonis Apr 16, 2025
0b3423f
Add missing quote
antonis Apr 24, 2025
5c615fd
Remove unneeded async
antonis Jun 10, 2025
c356288
Set useNativeInit = false by default
antonis Jun 10, 2025
8e32556
dynamically fill white spaces
antonis Jun 10, 2025
a20984c
Add unsupported language in warning message
antonis Jun 11, 2025
d1db4fa
Add objcpp in detected languages
antonis Jun 11, 2025
7c25c2c
Merge branch 'antonis/4625-expo-useNativeInit' of https://github.com/…
antonis Jun 11, 2025
1918baf
Update tests for objcpp
antonis Jun 11, 2025
b2a89f2
ref(expo-plugin): Split utils to logger, version and utils (#4906)
krystofwoldrich Jun 16, 2025
3885d70
Merge branch 'capture-app-start-errors' into antonis/4625-expo-useNat…
lucas-zimerman Oct 15, 2025
d705efb
Merge capture-app-start-errors-v7 into antonis/4625-expo-useNativeInit
antonis Dec 15, 2025
c318d40
Update changelog
antonis Dec 15, 2025
1c2a7b7
Merge branch 'capture-app-start-errors-v7' into antonis/4625-expo-use…
antonis Dec 16, 2025
45841f4
Merge branch 'capture-app-start-errors-v7' into antonis/4625-expo-use…
antonis Dec 22, 2025
7f5831a
Merge branch 'capture-app-start-errors-v7' into antonis/4625-expo-use…
antonis Dec 23, 2025
6a98684
Merge branch 'capture-app-start-errors-v7' into antonis/4625-expo-use…
antonis Jan 15, 2026
ccc2bdd
Merge branch 'capture-app-start-errors-v7' into antonis/4625-expo-use…
antonis Jan 16, 2026
f0b8563
Merge branch 'capture-app-start-errors-v7' into antonis/4625-expo-use…
antonis Jan 21, 2026
283e0a0
fix(ios): Add Swift module support for RNSentrySDK native init
antonis Jan 21, 2026
630ffe3
Merge branch 'capture-app-start-errors-v7' into antonis/4625-expo-use…
antonis Jan 21, 2026
05327d4
Fix test
antonis Jan 21, 2026
82f7b42
Merge branch 'capture-app-start-errors-v7' into antonis/4625-expo-use…
antonis Jan 21, 2026
a1b22f7
Update changelog
antonis Jan 21, 2026
3e4b6b6
Fix native tests
antonis Jan 21, 2026
0544c2a
Fix lint issue
antonis Jan 21, 2026
da4e782
Fix native tests
antonis Jan 22, 2026
47ebf09
Revert unneeded changes
antonis Jan 22, 2026
c0de079
Merge branch 'capture-app-start-errors-v7' into antonis/4625-expo-use…
antonis Jan 22, 2026
3a349f2
Fix sample app build
antonis Jan 22, 2026
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
Prev Previous commit
Next Next commit
Warn if RESentySDK.init/start wasn't injected
  • Loading branch information
antonis committed Apr 4, 2025
commit d25db305aaed11e2a8d5e9657ffae4fcc5287eee
8 changes: 8 additions & 0 deletions packages/core/plugin/src/withSentryAndroid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@ export function modifyMainApplication(config: ExpoConfig): ExpoConfig {
);
}
// Add RNSentrySDK.init
const originalContents = config.modResults.contents;
config.modResults.contents = config.modResults.contents.replace(
/(super\.onCreate\(\)[;\n]*)([ \t]*)/,
`$1\n$2RNSentrySDK.init(this);\n$2`,
);
if (config.modResults.contents === originalContents) {
warnOnce(`Failed to insert 'RNSentrySDK.init'.`);
}
} else {
// Kotlin
if (!config.modResults.contents.includes('import io.sentry.react.RNSentrySDK')) {
Expand All @@ -94,10 +98,14 @@ export function modifyMainApplication(config: ExpoConfig): ExpoConfig {
);
}
// Add RNSentrySDK.init
const originalContents = config.modResults.contents;
config.modResults.contents = config.modResults.contents.replace(
/(super\.onCreate\(\)[;\n]*)([ \t]*)/,
`$1\n$2RNSentrySDK.init(this)\n$2`,
);
if (config.modResults.contents === originalContents) {
warnOnce(`Failed to insert 'RNSentrySDK.init'.`);
}
}

return config;
Expand Down
8 changes: 8 additions & 0 deletions packages/core/plugin/src/withSentryIOS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,14 @@ export function modifyAppDelegate(config: ExpoConfig): ExpoConfig {
config.modResults.contents = config.modResults.contents.replace(/(import UIKit\n)/, `$1import RNSentry\n`);
}
// Add RNSentrySDK.start() at the beginning of application method
const originalContents = config.modResults.contents;
config.modResults.contents = config.modResults.contents.replace(
/(func application\([^)]*\) -> Bool \{)/s,
`$1\n RNSentrySDK.start()`,
);
if (config.modResults.contents === originalContents) {
warnOnce(`Failed to insert 'RNSentrySDK.start()'.`);
}
} else {
// Objective-C
if (config.modResults.contents.includes('[RNSentrySDK start]')) {
Expand All @@ -123,10 +127,14 @@ export function modifyAppDelegate(config: ExpoConfig): ExpoConfig {
);
}
// Add [RNSentrySDK start] at the beginning of application:didFinishLaunchingWithOptions method
const originalContents = config.modResults.contents;
config.modResults.contents = config.modResults.contents.replace(
/(- \(BOOL\)application:[\s\S]*?didFinishLaunchingWithOptions:[\s\S]*?\{\n)(\s*)/s,
`$1$2[RNSentrySDK start];\n$2`,
);
if (config.modResults.contents === originalContents) {
warnOnce(`Failed to insert '[RNSentrySDK start]'.`);
}
}

return config;
Expand Down
Loading