Commit a58bdcc
authored
fix(android): use reactApplicationContext directly in trackDeepLinks (#1146)
trackDeepLinks() accessed SovranModule through the old ReactNativeHost
chain (ReactApplication -> reactNativeHost -> reactInstanceManager ->
currentReactContext -> getNativeModule), which throws a RuntimeException
on React Native's New Architecture (Bridgeless mode):
"You should not use ReactNativeHost directly in the New Architecture"
The fix uses reactApplicationContext.getNativeModule() directly, which
is the same pattern already used by setAnonymousId() in this class.
Also removes unused ReactApplication and ReactActivity imports.1 parent 8850949 commit a58bdcc
1 file changed
Lines changed: 1 addition & 7 deletions
File tree
- packages/core/android/src/main/java/com/segmentanalyticsreactnative
Lines changed: 1 addition & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
| |||
217 | 215 | | |
218 | 216 | | |
219 | 217 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
| 218 | + | |
225 | 219 | | |
226 | 220 | | |
227 | 221 | | |
| |||
0 commit comments