@bugsee/react-native 0.0.0-stage → 7.0.0-beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. package/BugseeReactNative.podspec +95 -0
  2. package/LICENSE +21 -0
  3. package/README.md +552 -2
  4. package/android/build.gradle +162 -0
  5. package/android/consumer-rules.pro +2 -0
  6. package/android/src/main/AndroidManifest.xml +33 -0
  7. package/android/src/main/java/com/bugsee/reactnative/AppearanceBridge.java +82 -0
  8. package/android/src/main/java/com/bugsee/reactnative/AttributeBridge.java +209 -0
  9. package/android/src/main/java/com/bugsee/reactnative/BreadcrumbFilterBridge.java +443 -0
  10. package/android/src/main/java/com/bugsee/reactnative/BridgeJson.java +168 -0
  11. package/android/src/main/java/com/bugsee/reactnative/BugseeModule.java +1869 -0
  12. package/android/src/main/java/com/bugsee/reactnative/BugseeOptionEnums.java +136 -0
  13. package/android/src/main/java/com/bugsee/reactnative/BugseePackage.java +42 -0
  14. package/android/src/main/java/com/bugsee/reactnative/BugseeReactNativeWrapper.java +200 -0
  15. package/android/src/main/java/com/bugsee/reactnative/BugseeStatusMapper.java +66 -0
  16. package/android/src/main/java/com/bugsee/reactnative/BugseeTokens.java +22 -0
  17. package/android/src/main/java/com/bugsee/reactnative/ConsoleEchoDedup.java +202 -0
  18. package/android/src/main/java/com/bugsee/reactnative/CreatedReports.java +127 -0
  19. package/android/src/main/java/com/bugsee/reactnative/DataRequestBridge.java +375 -0
  20. package/android/src/main/java/com/bugsee/reactnative/ExceptionBridge.java +88 -0
  21. package/android/src/main/java/com/bugsee/reactnative/ExceptionExecutors.java +33 -0
  22. package/android/src/main/java/com/bugsee/reactnative/LogFilterBridge.java +375 -0
  23. package/android/src/main/java/com/bugsee/reactnative/NetworkEvents.java +227 -0
  24. package/android/src/main/java/com/bugsee/reactnative/NetworkFilterBridge.java +498 -0
  25. package/android/src/main/java/com/bugsee/reactnative/PluginEndpoint.java +48 -0
  26. package/android/src/main/java/com/bugsee/reactnative/ReactNativeWebException.java +19 -0
  27. package/android/src/main/java/com/bugsee/reactnative/ReactNativeWrapperInitProvider.java +61 -0
  28. package/android/src/main/java/com/bugsee/reactnative/ReactRootOriginTracker.java +867 -0
  29. package/android/src/main/java/com/bugsee/reactnative/ReportArgs.java +58 -0
  30. package/android/src/main/java/com/bugsee/reactnative/ReportHandlerBridge.java +336 -0
  31. package/android/src/main/java/com/bugsee/reactnative/ReportHandlerDeadlines.java +57 -0
  32. package/android/src/main/java/com/bugsee/reactnative/ReportOps.java +287 -0
  33. package/android/src/main/java/com/bugsee/reactnative/SecureRectanglePulls.java +113 -0
  34. package/android/src/main/java/com/bugsee/reactnative/SecureRectangleStore.java +692 -0
  35. package/android/src/main/java/com/bugsee/reactnative/SpanHandles.java +143 -0
  36. package/android/src/main/java/com/bugsee/reactnative/WrapperChannelHolder.java +137 -0
  37. package/android/src/main/java/com/bugsee/reactnative/WrapperEventBus.java +110 -0
  38. package/android/src/main/java/com/bugsee/reactnative/WrapperRegistrar.java +54 -0
  39. package/app.plugin.js +4 -0
  40. package/ios/BGSRNConsoleCapture.h +52 -0
  41. package/ios/BGSRNConsoleCapture.mm +344 -0
  42. package/ios/BugseeModule.h +25 -0
  43. package/ios/BugseeModule.mm +2728 -0
  44. package/ios/Package.swift +71 -0
  45. package/ios/Support/Package.resolved +14 -0
  46. package/ios/Support/Package.swift +44 -0
  47. package/ios/Support/Sources/BugseeRNSupport/BGSRNAttributes.m +52 -0
  48. package/ios/Support/Sources/BugseeRNSupport/BGSRNCreatedReportOps.m +236 -0
  49. package/ios/Support/Sources/BugseeRNSupport/BGSRNCreatedReports.m +184 -0
  50. package/ios/Support/Sources/BugseeRNSupport/BGSRNDataRequestBridge.m +431 -0
  51. package/ios/Support/Sources/BugseeRNSupport/BGSRNErrorMessage.m +40 -0
  52. package/ios/Support/Sources/BugseeRNSupport/BGSRNEventBus.m +70 -0
  53. package/ios/Support/Sources/BugseeRNSupport/BGSRNExceptions.m +63 -0
  54. package/ios/Support/Sources/BugseeRNSupport/BGSRNGuardedEmit.mm +32 -0
  55. package/ios/Support/Sources/BugseeRNSupport/BGSRNJSON.m +40 -0
  56. package/ios/Support/Sources/BugseeRNSupport/BGSRNLaunchHold.m +147 -0
  57. package/ios/Support/Sources/BugseeRNSupport/BGSRNMainThread.m +23 -0
  58. package/ios/Support/Sources/BugseeRNSupport/BGSRNNetworkEvents.m +159 -0
  59. package/ios/Support/Sources/BugseeRNSupport/BGSRNNetworkFilter.m +155 -0
  60. package/ios/Support/Sources/BugseeRNSupport/BGSRNPluginEndpoint.m +21 -0
  61. package/ios/Support/Sources/BugseeRNSupport/BGSRNReactRootOriginTracker.m +63 -0
  62. package/ios/Support/Sources/BugseeRNSupport/BGSRNReactWindow.m +251 -0
  63. package/ios/Support/Sources/BugseeRNSupport/BGSRNReportArgs.m +47 -0
  64. package/ios/Support/Sources/BugseeRNSupport/BGSRNReportDeadlines.m +8 -0
  65. package/ios/Support/Sources/BugseeRNSupport/BGSRNReportHandlerBridge.m +308 -0
  66. package/ios/Support/Sources/BugseeRNSupport/BGSRNReportOps.m +345 -0
  67. package/ios/Support/Sources/BugseeRNSupport/BGSRNSecureRectangles.m +508 -0
  68. package/ios/Support/Sources/BugseeRNSupport/BGSRNSettleOnce.m +62 -0
  69. package/ios/Support/Sources/BugseeRNSupport/BGSRNSpanHandles.m +136 -0
  70. package/ios/Support/Sources/BugseeRNSupport/BGSRNStatusMapper.m +18 -0
  71. package/ios/Support/Sources/BugseeRNSupport/BGSRNTokens.m +9 -0
  72. package/ios/Support/Sources/BugseeRNSupport/BGSRNValues.m +5 -0
  73. package/ios/Support/Sources/BugseeRNSupport/BGSRNWrapper.m +54 -0
  74. package/ios/Support/Sources/BugseeRNSupport/BGSRNWrapperChannelHolder.m +59 -0
  75. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNAttributes.h +63 -0
  76. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNCreatedReportOps.h +51 -0
  77. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNCreatedReports.h +81 -0
  78. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNDataRequestBridge.h +118 -0
  79. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNErrorMessage.h +30 -0
  80. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNEventBus.h +45 -0
  81. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNExceptions.h +31 -0
  82. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNGuardedEmit.h +31 -0
  83. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNJSON.h +25 -0
  84. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNLaunchHold.h +86 -0
  85. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNMainThread.h +32 -0
  86. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNNetworkEvents.h +28 -0
  87. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNNetworkFilter.h +28 -0
  88. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNPluginEndpoint.h +17 -0
  89. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReactRootOriginTracker.h +48 -0
  90. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReactWindow.h +135 -0
  91. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportArgs.h +17 -0
  92. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportDeadlines.h +37 -0
  93. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportHandlerBridge.h +94 -0
  94. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNReportOps.h +86 -0
  95. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNSecureRectangles.h +198 -0
  96. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNSettleOnce.h +25 -0
  97. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNSpanHandles.h +49 -0
  98. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNStatusMapper.h +26 -0
  99. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNTokens.h +14 -0
  100. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNValues.h +18 -0
  101. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNWrapper.h +40 -0
  102. package/ios/Support/Sources/BugseeRNSupport/include/BGSRNWrapperChannelHolder.h +74 -0
  103. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNAttributesTests.m +194 -0
  104. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNCreatedReportOpsTests.m +274 -0
  105. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNCreatedReportsTests.m +240 -0
  106. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNDataRequestBridgeTests.m +685 -0
  107. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNErrorMessageTests.m +102 -0
  108. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNEventBusTests.m +136 -0
  109. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNExceptionsTests.m +68 -0
  110. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNFakeReport.h +41 -0
  111. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNFakeReport.m +166 -0
  112. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNGuardedEmitTests.mm +85 -0
  113. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNJSONTests.m +281 -0
  114. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNLaunchHoldTests.m +230 -0
  115. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNMainThreadTests.m +97 -0
  116. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNNetworkEventsTests.m +99 -0
  117. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNNetworkFilterTests.m +134 -0
  118. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNPluginEndpointTests.m +38 -0
  119. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReactRootOriginTrackerTests.m +210 -0
  120. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReactWindowTests.m +548 -0
  121. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportArgsTests.m +51 -0
  122. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportDeadlinesTests.m +22 -0
  123. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportHandlerBridgeTests.m +382 -0
  124. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNReportOpsTests.m +295 -0
  125. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNSecureRectanglesTests.m +568 -0
  126. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNSettleOnceTests.m +134 -0
  127. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNSpanHandlesTests.m +153 -0
  128. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNStatusMapperTests.m +81 -0
  129. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNValuesTests.m +32 -0
  130. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNWrapperChannelHolderTests.m +205 -0
  131. package/ios/Support/Tests/BugseeRNSupportTests/BGSRNWrapperTests.m +66 -0
  132. package/ios/react-native-spm-prefix.h +10 -0
  133. package/native-versions.json +10 -0
  134. package/package.json +62 -3
  135. package/plugin/build/bundle-phase.d.ts +41 -0
  136. package/plugin/build/bundle-phase.js +116 -0
  137. package/plugin/build/bundle-phase.js.map +1 -0
  138. package/plugin/build/dsym-script.d.ts +32 -0
  139. package/plugin/build/dsym-script.js +159 -0
  140. package/plugin/build/dsym-script.js.map +1 -0
  141. package/plugin/build/endpoint.d.ts +30 -0
  142. package/plugin/build/endpoint.js +69 -0
  143. package/plugin/build/endpoint.js.map +1 -0
  144. package/plugin/build/gradle.d.ts +65 -0
  145. package/plugin/build/gradle.js +1066 -0
  146. package/plugin/build/gradle.js.map +1 -0
  147. package/plugin/build/index.d.ts +85 -0
  148. package/plugin/build/index.js +217 -0
  149. package/plugin/build/index.js.map +1 -0
  150. package/plugin/build/manifest.d.ts +48 -0
  151. package/plugin/build/manifest.js +69 -0
  152. package/plugin/build/manifest.js.map +1 -0
  153. package/plugin/build/native-versions.baked.json +4 -0
  154. package/plugin/build/native-versions.d.ts +10 -0
  155. package/plugin/build/native-versions.js +27 -0
  156. package/plugin/build/native-versions.js.map +1 -0
  157. package/plugin/build/pbx-string.d.ts +8 -0
  158. package/plugin/build/pbx-string.js +31 -0
  159. package/plugin/build/pbx-string.js.map +1 -0
  160. package/plugin/build/podfile.d.ts +3 -0
  161. package/plugin/build/podfile.js +28 -0
  162. package/plugin/build/podfile.js.map +1 -0
  163. package/plugin/build/properties.d.ts +19 -0
  164. package/plugin/build/properties.js +41 -0
  165. package/plugin/build/properties.js.map +1 -0
  166. package/plugin/build/scheme.d.ts +20 -0
  167. package/plugin/build/scheme.js +107 -0
  168. package/plugin/build/scheme.js.map +1 -0
  169. package/react-native.config.js +26 -0
  170. package/scripts/bugsee-sourcemaps.gradle +201 -0
  171. package/scripts/bugsee-xcode.sh +83 -0
  172. package/scripts/compose-then-inject.js +113 -0
  173. package/scripts/hermes-sourcemaps.js +634 -0
  174. package/scripts/hermesc-preserve-js.cmd +6 -0
  175. package/scripts/hermesc-preserve-js.js +200 -0
  176. package/scripts/hermesc-preserve-js.sh +7 -0
  177. package/src/NativeBugsee.ts +622 -0
  178. package/src/apm/notify.ts +58 -0
  179. package/src/apm/span.ts +403 -0
  180. package/src/apm/types.ts +57 -0
  181. package/src/appearance/report.ts +171 -0
  182. package/src/architecture.ts +48 -0
  183. package/src/attributes/errors.ts +39 -0
  184. package/src/attributes/validate.ts +150 -0
  185. package/src/breadcrumbs/add.ts +58 -0
  186. package/src/breadcrumbs/data.ts +33 -0
  187. package/src/breadcrumbs/filter.ts +215 -0
  188. package/src/breadcrumbs/types.ts +64 -0
  189. package/src/bridge/json.ts +110 -0
  190. package/src/console/capture.ts +180 -0
  191. package/src/console/dedup.ts +175 -0
  192. package/src/data/validate.ts +259 -0
  193. package/src/errorName.ts +32 -0
  194. package/src/exceptions/ErrorBoundary.tsx +92 -0
  195. package/src/exceptions/RootErrorReporter.tsx +61 -0
  196. package/src/exceptions/debugIds.ts +118 -0
  197. package/src/exceptions/handlers.ts +236 -0
  198. package/src/exceptions/options.ts +85 -0
  199. package/src/exceptions/payload.ts +456 -0
  200. package/src/exceptions/report.ts +170 -0
  201. package/src/exceptions/sha1.ts +148 -0
  202. package/src/exceptions/stack.ts +355 -0
  203. package/src/index.ts +944 -0
  204. package/src/logs/filter.ts +90 -0
  205. package/src/logs/log.ts +36 -0
  206. package/src/network/add.ts +165 -0
  207. package/src/network/filter.ts +198 -0
  208. package/src/options/AndroidLaunchOptions.ts +78 -0
  209. package/src/options/BugseeLaunchOptions.ts +190 -0
  210. package/src/options/IOSLaunchOptions.ts +57 -0
  211. package/src/options/android-options-manifest.json +646 -0
  212. package/src/options/createDefaultLaunchOptions.ts +29 -0
  213. package/src/options/endpoint.ts +58 -0
  214. package/src/options/enums.ts +104 -0
  215. package/src/options/ios-enums.json +19 -0
  216. package/src/options/keys.ts +39 -0
  217. package/src/options/option-enums.json +34 -0
  218. package/src/options/option-keys.json +107 -0
  219. package/src/report/BugseeReport.ts +264 -0
  220. package/src/report/CreatedReport.ts +127 -0
  221. package/src/report/dispatcher.ts +95 -0
  222. package/src/report/errors.ts +48 -0
  223. package/src/report/fields.ts +40 -0
  224. package/src/report/types.ts +157 -0
  225. package/src/report/validate.ts +197 -0
  226. package/src/secure/BugseeSecure.tsx +202 -0
  227. package/src/secure/ancestry.ts +622 -0
  228. package/src/secure/drivers.ts +342 -0
  229. package/src/secure/followEvents.ts +57 -0
  230. package/src/secure/hold.ts +99 -0
  231. package/src/secure/measureLoop.ts +323 -0
  232. package/src/secure/nativeAnimation.ts +1005 -0
  233. package/src/secure/rectangles.ts +93 -0
  234. package/src/secure/registry.ts +237 -0
  235. package/src/secure/surface.ts +83 -0
  236. package/src/secure/tracker.ts +723 -0
  237. package/src/secure/transition.ts +488 -0
  238. package/src/secure/unit.ts +22 -0
  239. package/src/status.ts +16 -0
  240. package/src/version.ts +9 -0
  241. package/src/viewtree/anchor.tsx +105 -0
  242. package/src/viewtree/constants.ts +20 -0
  243. package/src/viewtree/fiber.ts +251 -0
  244. package/src/viewtree/requests.ts +347 -0
  245. package/src/viewtree/walk.ts +902 -0
  246. package/src/wrapper/channel.ts +33 -0
  247. package/src/wrapper/collect.ts +52 -0
  248. package/src/wrapper/events.ts +45 -0
  249. package/src/wrapper/identity.ts +54 -0
  250. package/src/wrapper/lifecycle-events.ts +89 -0
@@ -0,0 +1,95 @@
1
+ require 'json'
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
+ # The one source of every native pin. In this repo it is the root file. In an
5
+ # app the package sits in node_modules, where the root file is not above it, so
6
+ # prepack ships a copy at the package root (scripts/pack-native-versions.ts);
7
+ # that copy is read first.
8
+ native_versions_file = [
9
+ File.join(__dir__, 'native-versions.json'),
10
+ File.join(__dir__, '..', '..', 'native-versions.json'),
11
+ ].find { |path| File.file?(path) }
12
+ raise "native-versions.json not found in #{__dir__} or the repo root above it" unless native_versions_file
13
+ native = JSON.parse(File.read(native_versions_file))
14
+
15
+ Pod::Spec.new do |s|
16
+ s.name = 'BugseeReactNative'
17
+ s.version = package['version']
18
+ s.summary = package['description']
19
+ s.homepage = package['homepage']
20
+ # No :file — the path would be resolved against this package's directory as
21
+ # the autolinker symlinks it into an app's node_modules, so `../../LICENSE`
22
+ # lands in <app>/node_modules/LICENSE and CocoaPods warns it cannot be read.
23
+ s.license = { :type => 'MIT', :text => 'The wrapper is MIT, see LICENSE in the package root. The native Bugsee SDK it bundles is a separate package with its own terms.' }
24
+ s.author = 'Bugsee'
25
+ # React Native's floor, read from React Native, so it tracks whichever
26
+ # version the app is on rather than drifting. RN defines this top-level
27
+ # helper in scripts/react_native_pods.rb, which every RN Podfile requires,
28
+ # so it is in scope by the time CocoaPods evaluates this podspec; the
29
+ # literal is the fallback for evaluation outside an app (`pod spec lint`).
30
+ # Bugsee itself floors at 15.0 (since 7.0.0-beta2; the bugsee/spm manifest
31
+ # declares .iOS(.v15)), just below React Native's 15.1, so React Native's is
32
+ # the floor that binds and an app can never sit lower than this.
33
+ s.platforms = {
34
+ :ios => defined?(min_ios_version_supported) ? min_ios_version_supported : '15.1'
35
+ }
36
+ s.source = { :path => '.' }
37
+
38
+ s.source_files = 'ios/**/*.{h,m,mm}'
39
+ # The SPM package under ios/Support is compiled by SPM on the other delivery
40
+ # path; here its sources are part of this pod, so exclude only its manifest.
41
+ s.exclude_files = 'ios/Support/Package.swift', 'ios/Support/Tests/**/*'
42
+
43
+ # Bugsee is NOT a CocoaPods dependency: nothing is published to trunk, and
44
+ # never will be. What ships on the SPM channel is a plain xcframework zip at
45
+ # a stable URL, so this vendors that same artifact directly.
46
+ #
47
+ # Deliberately NOT `spm_dependency`. That helper attaches the package product
48
+ # to the Pods project target, and nothing then embeds the framework into the
49
+ # app: a static pod fails to link it at all, and a dynamic one links it and
50
+ # ships an app that dyld-crashes on launch. Both were reproduced. CocoaPods
51
+ # does embed and sign a vendored framework correctly, which is the whole
52
+ # reason this path exists.
53
+ s.vendored_frameworks = "Bugsee.xcframework"
54
+ # The cache is keyed by VERSION, not by mere presence. Checking only that a
55
+ # directory exists means a version bump never replaces an already-downloaded
56
+ # xcframework: `pod install` succeeds, CI goes green, and the app ships the
57
+ # previous SDK. The stamp file records what was unpacked.
58
+ s.prepare_command = <<-CMD
59
+ set -e
60
+ VERSION="#{native['ios']['sdk']}"
61
+ STAMP=".bugsee-xcframework-version"
62
+ if [ ! -d "Bugsee.xcframework" ] || [ "$(cat "${STAMP}" 2>/dev/null)" != "${VERSION}" ]; then
63
+ # A download directory of this run's own. A fixed /tmp path is shared by
64
+ # every pod install on the machine: two at once overwrote and deleted
65
+ # each other's archive mid-extract ("bad CRC").
66
+ WORK="$(mktemp -d "${TMPDIR:-/tmp}/bugsee-xcframework.XXXXXX")"
67
+ # Unpacked beside its destination, so the final mv is a rename on one
68
+ # filesystem: a failed download or extract leaves nothing half-written.
69
+ STAGE="$(mktemp -d "./.bugsee-xcframework.XXXXXX")"
70
+ trap 'rm -rf "${WORK}" "${STAGE}"' EXIT
71
+ curl -sSfL -o "${WORK}/Bugsee.zip" \
72
+ "https://download.bugsee.com/sdk/ios/spm/Bugsee-${VERSION}.zip"
73
+ # Only the framework. The archive also carries the iOS SDK's own
74
+ # README.md and LICENSE at its root, and extracting everything drops
75
+ # them into this package -- where npm publishes README.md and LICENSE
76
+ # whatever `files` says. That is how this package came to ship the SDK's
77
+ # CocoaPods instructions and PLCrashReporter's licence.
78
+ unzip -q -o "${WORK}/Bugsee.zip" 'Bugsee.xcframework/*' -d "${STAGE}"
79
+ rm -rf "Bugsee.xcframework"
80
+ mv "${STAGE}/Bugsee.xcframework" "Bugsee.xcframework"
81
+ printf '%s' "${VERSION}" > "${STAMP}"
82
+ fi
83
+ CMD
84
+
85
+ s.requires_arc = true
86
+ # A Swift pod integrated as a static library can only depend on pods that
87
+ # define a module. BugseeReactNativeFeedback does, and this pod is that
88
+ # dependency. Without this, `pod install` stops before it compiles anything.
89
+ s.pod_target_xcconfig = {
90
+ 'DEFINES_MODULE' => 'YES'
91
+ }
92
+ s.dependency 'React-Core'
93
+
94
+ install_modules_dependencies(s) if defined?(install_modules_dependencies)
95
+ end
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Bugsee
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,553 @@
1
- # Temporary Holding Version
1
+ # @bugsee/react-native
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Bugsee for React Native. Crash, error and bug reports carrying the video,
4
+ network traffic, console logs and traces that led up to them.
5
+
6
+ Wraps the native Bugsee SDKs — it is not a reimplementation — so a report from
7
+ a React Native app is the same report a native app produces, with the JS layer
8
+ added.
9
+
10
+ ## Status: beta
11
+
12
+ This is a beta (`7.0.0-beta1`), built on the 7.x native SDKs, and the iOS SDK it
13
+ bundles is itself a beta. It is published under the `beta` npm dist-tag only, so
14
+ a plain `yarn add @bugsee/react-native` finds nothing: ask for the tag, as in
15
+ [Install](#install). The API can still change between betas.
16
+
17
+ It replaces `react-native-bugsee` (6.x), which stays on its own line. The two
18
+ are different packages with different APIs, not an upgrade in place: remove the
19
+ old one and follow this README.
20
+
21
+ ## Requirements
22
+
23
+ | | |
24
+ |---|---|
25
+ | React Native | 0.81 or later, New Architecture enabled |
26
+ | iOS | 15.0 or later |
27
+ | Android | API 21 or later |
28
+ | JavaScript engine | Hermes (React Native's default) |
29
+
30
+ The New Architecture is the default from React Native 0.76. On 0.81 it can
31
+ still be turned off; this package requires it on.
32
+
33
+ Hermes is required; JavaScriptCore (Hermes off) is not supported. React
34
+ Native removed JSC from core in 0.81, and the community package that replaces
35
+ it, `@react-native-community/javascriptcore`, does not work with current React
36
+ Native: its Android JSC cannot parse React Native's own bundle, and its iOS
37
+ build fails on 0.86 and 0.87.
38
+
39
+ ## Install
40
+
41
+ ```sh
42
+ yarn add @bugsee/react-native@beta
43
+ ```
44
+
45
+ `npm install @bugsee/react-native@beta` and `pnpm add @bugsee/react-native@beta` work the
46
+ same way.
47
+
48
+ **iOS.** React Native 0.87 and later resolve the SDK through Swift Package
49
+ Manager. Earlier versions use CocoaPods, where the podspec vendors the same
50
+ XCFramework — run `pod install` as usual. Nothing is published to CocoaPods
51
+ trunk, so no `pod repo update` is needed.
52
+
53
+ **Android.** Autolinking picks the module up, and the app builds and
54
+ launches with no Gradle changes. Release symbolication needs the Bugsee Gradle
55
+ plugin and the source-map hooks: see [Release symbolication](#release-symbolication).
56
+
57
+ **pnpm 10 and later** run no dependency's install script unless the project
58
+ decides, and pnpm 11 fails the install until it does
59
+ (`ERR_PNPM_IGNORED_BUILDS`): `@bugsee/cli`, which uploads symbols and source
60
+ maps, has a `postinstall`. Its binary comes from a platform-specific optional
61
+ dependency, so the script is only a download fallback for registry mirrors
62
+ that lack those packages. Decide in `pnpm-workspace.yaml`:
63
+
64
+ ```yaml
65
+ allowBuilds:
66
+ '@bugsee/cli': false # true only if your registry lacks @bugsee/cli-<platform>
67
+ ```
68
+
69
+ React Native itself also needs `nodeLinker: hoisted` under pnpm.
70
+
71
+ ## Use
72
+
73
+ ```ts
74
+ import Bugsee, { BugseeLaunchOptions, createDefaultLaunchOptions } from '@bugsee/react-native';
75
+
76
+ const options = createDefaultLaunchOptions();
77
+ options.captureLogs = true;
78
+
79
+ await Bugsee.launch('<your app token>', BugseeLaunchOptions.serialize(options));
80
+ ```
81
+
82
+ `launch` resolves to whether the SDK started. It can decline — already
83
+ running, or a token the backend rejects — without that being an error worth
84
+ throwing on. Capture comes up asynchronously, so poll `getStatus()` rather
85
+ than assuming a resolved `launch` means recording has begun.
86
+
87
+ ### Hiding a view from recordings
88
+
89
+ Wrap anything that must never be recorded in `<BugseeSecure>`:
90
+
91
+ ```tsx
92
+ import { BugseeSecure } from '@bugsee/react-native';
93
+
94
+ <BugseeSecure>
95
+ <Text>{accountNumber}</Text>
96
+ </BugseeSecure>
97
+ ```
98
+
99
+ The part of it that is on screen is masked, and taps on it are dropped, while
100
+ it is mounted and `enabled` (default `true`). It follows scrolling, hidden
101
+ screens, react-native-screens push and pop transitions, sliding `<Modal>`s and
102
+ `Animated` transforms driven by the native driver, masking more rather than
103
+ less where it cannot tell exactly. `enabled={false}` unmasks at once; an
104
+ unmount keeps the mask for about half a second, as native may still draw the
105
+ view.
106
+
107
+ Known limits:
108
+
109
+ - Content that mounts in a pushed screen or an opening `<Modal>` after it
110
+ came (behind a spinner), or that is first shown on the screen a pop
111
+ uncovers, is masked for the rest of the transition. When a screen came or
112
+ went is known only if a `<BugseeSecure>` saw it; otherwise the first one to
113
+ look masks as if it happened then (the whole screen, or the Modal's band,
114
+ for under a second).
115
+ - A value a native event drives (an `Animated.event` in an `Animated`
116
+ component's `onScroll` or `onGestureEvent`, or `Animated.attachNativeEvent`,
117
+ which React Native's own ScrollView uses for `stickyHeaderIndices`) moves
118
+ with the scroll or the gesture. What it transforms is masked wherever it can
119
+ be drawn, for as long as the event is attached, idle or not:
120
+ - a clamped interpolation, one whose ends are flat (a swipeable row without
121
+ overshoot), or a `diffClamp`: over its output range;
122
+ - on Android, a ScrollView's `contentOffset`, vertical or horizontal (a
123
+ collapsing or parallax header, a sticky header): over the offsets the
124
+ ScrollView can reach, from its measured content and viewport, plus 64 dp
125
+ either way for a fling's overrun (AOSP flings 6 dp past an end; the
126
+ margin assumes no device flings more than ten times that). A view inside
127
+ the content of the ScrollView whose offset drives it (a sticky header,
128
+ from `stickyHeaderIndices` or a `SectionList`) moves with that content
129
+ too, natively ahead of what JS measures: it is masked over that
130
+ ScrollView's whole viewport;
131
+ - anything else (a gesture's translation through an interpolation that
132
+ extends, an iOS ScrollView, which bounces and can be scrolled anywhere by
133
+ `scrollTo`, a ScrollView in another React root, or under a scale other
134
+ than 1): the whole surface around it, cut by the clipping ancestors above
135
+ it (a list's viewport, say).
136
+ - Native events are followed from when `@bugsee/react-native` is first
137
+ evaluated: with Metro's `inlineRequires`, its first use. Import it (or call
138
+ `Bugsee.launch`) at the top of `index.js` to follow them from the start.
139
+ A value made native before then is masked as if anything could drive it,
140
+ until JS next animates or sets it. A native event attached without
141
+ `Animated` (code that calls React Native's native Animated module itself)
142
+ is not seen at all, and the value it drives is taken to be where JS last
143
+ had it.
144
+ - A transform animated from JS (`useNativeDriver: false`) is followed every
145
+ frame while its animation runs. Other styles a JS animation moves (`top`,
146
+ `left`, `margin`, a size) are followed by the 100 ms re-measure only.
147
+ - Reanimated runs its animations on the UI thread, out of JS's sight. A
148
+ Reanimated component whose style sets a transform through an animated
149
+ style, sets a shared value inline, or uses a CSS animation or transition
150
+ masks the whole surface around it; other Reanimated motion (an animated
151
+ style that adds a transform only later, layout animations,
152
+ `entering`/`exiting`, shared element transitions) is not followed.
153
+ - An interactive back gesture (iOS swipe-back, Android predictive back) moves
154
+ a mounted screen without anything JS can see.
155
+ - The mask is published in the same JS task that starts a native animation
156
+ (or sets, resets or offsets an `Animated.Value`), but the two reach native
157
+ separately: under heavy load the animation's first frame could still be
158
+ drawn before the mask lands.
159
+
160
+ ## Expo config plugin
161
+
162
+ ```json
163
+ {
164
+ "expo": {
165
+ "plugins": [
166
+ ["@bugsee/react-native", { "appToken": { "ios": "<ios token>", "android": "<android token>" } }]
167
+ ]
168
+ }
169
+ }
170
+ ```
171
+
172
+ `appToken` is one string for both platforms, or one token per platform. On
173
+ `expo prebuild` the plugin wires the Bugsee Gradle plugin, the Hermes debug-id
174
+ hooks and the iOS dSYM Archive action. Release builds then upload their source
175
+ maps, and Archives upload their dSYMs, whenever a real token is set.
176
+ `uploadSourcemaps: false` and `uploadSymbols: false` turn those uploads off.
177
+ A committed `ios/` (`project.pbxproj` and the shared scheme) or
178
+ `android/bugsee.properties` carries the token.
179
+
180
+ With the config plugin, no upload runs with a missing token or the placeholder token
181
+ (`00000000-0000-4000-8000-000000000000`, the version and variant digits
182
+ aside): the source-map upload, the Archive dSYM post-action and the Bugsee
183
+ Gradle plugin's mapping, symbol and build uploads each skip, with one line in
184
+ the build log (for the post-action: `warning: bugsee: dSYM upload skipped: the
185
+ app token is the placeholder`), and the build or Archive carries on. For
186
+ Android the plugin simply leaves the placeholder out of `bugsee.properties`.
187
+
188
+ ### Self-hosted, staging or regional endpoint
189
+
190
+ ```json
191
+ ["@bugsee/react-native", { "appToken": "<token>", "endpoint": "https://bugsee.example.com" }]
192
+ ```
193
+
194
+ `endpoint` is the API base: `https://`, a host, an optional port and path, and
195
+ no credentials, query, fragment or `/v2` (each reader adds the API version
196
+ itself). Anything else fails the prebuild. Unset, the default, everything stays
197
+ on Bugsee's production API. Set, it reaches every upload and the runtime:
198
+
199
+ - Android: `plugin.endpoint` in `android/bugsee.properties`, for the Gradle
200
+ plugin's uploads and the source-map upload; `com.bugsee.reactnative.endpoint`
201
+ application meta-data for the SDK.
202
+ - iOS: `BUGSEE_ENDPOINT` in the bundle phase (source maps) and in the Archive
203
+ dSYM post-action; `BugseeReactNativeEndpoint` in `Info.plist` for the SDK.
204
+ - Runtime: `Bugsee.launch()` and `relaunch()` use it whenever their options
205
+ carry no `endpoint`; an `endpoint` you pass yourself wins.
206
+ `getLaunchOptions()` reads it back. With `autoLaunch` it is also written as
207
+ the auto-launched SDK's `com.bugsee.option.$$ENDPOINT`, unless your manifest
208
+ already has one, which is then left as it is.
209
+
210
+ Each of these is the plugin's own, so a later prebuild with a new value
211
+ replaces it, and one without `endpoint` removes it again.
212
+
213
+ The plugin's Gradle edits never remove or change a line of your own code, on a
214
+ clean or a `--no-clean` prebuild, however often it runs: it adds its own
215
+ marked lines, replaces only those, and rewrites exactly one of yours,
216
+ `react.hermesCommand`, with any trailing comment kept. Its own lines are
217
+ recognised only by their markers: the NDK dependency ends in `// bugsee:ndk`
218
+ (as does the opener of the `dependencies` block it adds when the file has
219
+ none). A `bugsee-android-ndk` dependency of your own, anywhere and however
220
+ written, is never touched: the plugin then adds none of its own and says so in
221
+ the prebuild log. The plugin writes no `debugSymbolLevel` (see
222
+ [Native symbols](#native-symbols-android)), and your own `ndk { }` block or
223
+ level is never touched. It inserts only at anchors that hold nothing but their
224
+ brace (`dependencies {`, `buildscript … }`, `pluginManagement {`,
225
+ `repositories {`; a trailing comment is fine), always as whole lines at your
226
+ indentation, and never splits a line. Where it cannot do that
227
+ with certainty it refuses the prebuild with one error that names the file,
228
+ the reason and the fix, and writes nothing. It refuses:
229
+
230
+ - a Kotlin DSL `settings.gradle.kts`, `build.gradle.kts` or app
231
+ `build.gradle.kts`;
232
+ - a Gradle file it cannot read for sure: a string that does not close on its
233
+ line, a comment or string still open at the end of the file, braces that do
234
+ not balance, or a `/` that could start a slashy string as well as divide;
235
+ - a `react.hermesCommand` that spans several lines or shares its line with
236
+ another statement after `;`;
237
+ - an anchor brace that shares its line with code: a one-line
238
+ `dependencies { … }`, a `buildscript { … }; …`, a one-line
239
+ `pluginManagement` or `repositories` block (with the option that needs that
240
+ edit on);
241
+ - a `gradlePluginVersion` option or a baked NDK version that is not a plain
242
+ version string.
243
+
244
+ A declaration of `com.bugsee.android.gradle` in `android/build.gradle` is
245
+ taken as the plugin's own pin, whoever wrote it: its version follows the
246
+ wrapper's on each prebuild. Gradle allows one `plugins {}` block per script,
247
+ so when the root file already has one the pin goes into it (its braces must
248
+ stand alone on their lines, or the prebuild refuses); a new block is written
249
+ only when there is none.
250
+
251
+ ## Release symbolication
252
+
253
+ A Release build has to send Bugsee what turns its crash frames back into
254
+ source: the JS source map (with a debug id that ties it to the shipped
255
+ bundle), the R8 mapping and the native (NDK) symbols on Android, and the
256
+ dSYMs on iOS. **An Expo app gets all of it from the config plugin.** A bare
257
+ app needs the three sections below — the Android source-map hooks, the Bugsee
258
+ Gradle plugin, and the iOS bundle phase. Without them the app still builds
259
+ and runs, but JS and native frames in Release reports stay unsymbolicated.
260
+
261
+ ## Android source maps
262
+
263
+ Release builds give the Hermes bundle a debug id and upload its source map, so
264
+ JS frames in a crash report resolve. An Expo app gets this from the config
265
+ plugin. A bare app needs two edits in `android/app/build.gradle`. Resolve the
266
+ package through node, as React Native's own template resolves
267
+ `react-native`, so a hoisted or nested install works too:
268
+
269
+ ```groovy
270
+ def bugseeDir = new File(["node", "--print", "require.resolve('@bugsee/react-native/package.json')"]
271
+ .execute(null, rootDir).text.trim()).getParentFile()
272
+
273
+ react {
274
+ // Copies the JS aside before hermesc compiles it, so the debug id can
275
+ // reach the bytecode. React Native runs this command through cmd on
276
+ // Windows, so Windows gets the .cmd launcher and macOS and Linux the .sh.
277
+ // Keep it on one line: tools that apply this snippet read it as one.
278
+ hermesCommand = new File(new File(bugseeDir, "scripts"), System.getProperty("os.name").startsWith("Windows") ? "hermesc-preserve-js.cmd" : "hermesc-preserve-js.sh").absolutePath
279
+ }
280
+
281
+ // At the end of the file. Applying it twice is harmless.
282
+ apply from: new File(new File(bugseeDir, "scripts"), "bugsee-sourcemaps.gradle")
283
+ ```
284
+
285
+ The OS is checked when Gradle configures the build, so one `build.gradle`
286
+ works on macOS, Linux and Windows. Both launchers run
287
+ `scripts/hermesc-preserve-js.js` with `node`, which must be on the `PATH` (as
288
+ React Native's own bundling already needs). The wrapper exits non-zero when
289
+ hermesc writes no bytecode.
290
+
291
+ If Hermes compiles a bundle without going through the wrapper, the bundle
292
+ task fails rather than ship a release without a debug id. On Windows a
293
+ `hermesCommand` that names a `.sh` (what earlier versions of this README
294
+ said) fails the bundle task before hermesc runs, with the line to use
295
+ instead: `cmd` cannot run a shell script. With Hermes off, the plain JS
296
+ bundle and Metro's map get the id instead.
297
+
298
+ - **The upload needs a real token.** Set `app_token` in
299
+ `android/bugsee.properties`, or `BUGSEE_APP_TOKEN`. Without a token, or with
300
+ `-PbugseeUploadSourcemaps=false`, the build skips the upload with one line. A
301
+ failed upload warns and does not fail the build.
302
+ - **The version and build number** are the variant's own, flavors included.
303
+ - **The preserve directory.** For a bundle at `build/generated/assets/<x>`
304
+ the wrapper keeps the JS in `build/intermediates/bugsee-sourcemaps/<x>`.
305
+ The wrapper and `hermes-sourcemaps.js` take the last `generated/assets` in
306
+ the path; the Gradle hook takes the path relative to the build directory.
307
+ The three agree unless the bundle directory itself nests another
308
+ `generated/assets`, which React Native never does.
309
+ - **Expo.** `expo prebuild` writes the same per-OS choice. A `hermesCommand`
310
+ that an earlier prebuild wrote (the `.sh` on every OS) is recognised by its
311
+ exact text and moved to the per-OS one; a `hermesCommand` of your own that
312
+ already names `hermesc-preserve-js` is left as it is.
313
+ - **Windows paths with spaces or brackets.** React Native runs
314
+ `hermesCommand` through `cmd /c`, which cuts an absolute path holding a
315
+ space together with `(` `)` (`C:\Program Files (x86)\…`), or `(` `)` alone
316
+ (`C:\Users\John(US)\…`). On Windows the hook gives the launcher to React
317
+ Native relative to the project root instead, as React Native gives its own
318
+ paths; the build is verified from `C:\s (x86)\b rn`. A project whose path is long
319
+ can still pass Windows' 260-character limit in React Native's own native
320
+ build, which has nothing to do with Bugsee.
321
+ - **Limitations.** The hook has not yet been verified with Gradle's
322
+ configuration cache.
323
+
324
+ ## Android: Bugsee Gradle plugin
325
+
326
+ Uploads the R8/ProGuard mapping, the native (NDK) symbols and the build info
327
+ of each Release build. It is a Gradle plugin, so autolinking cannot add it;
328
+ the config plugin writes these same edits for an Expo app.
329
+
330
+ `android/settings.gradle` — the plugin is published to Maven Central, which
331
+ Gradle does not search for plugins unless told to:
332
+
333
+ ```groovy
334
+ pluginManagement {
335
+ includeBuild("../node_modules/@react-native/gradle-plugin")
336
+ repositories {
337
+ gradlePluginPortal()
338
+ google()
339
+ mavenCentral()
340
+ }
341
+ }
342
+ ```
343
+
344
+ `android/build.gradle` — declare it at the version this package is built
345
+ against (`android.gradlePlugin` in
346
+ `node_modules/@bugsee/react-native/native-versions.json`), above
347
+ `apply plugin: "com.facebook.react.rootproject"`:
348
+
349
+ ```groovy
350
+ plugins {
351
+ id 'com.bugsee.android.gradle' version '4.0.8' apply false
352
+ }
353
+ ```
354
+
355
+ `android/app/build.gradle` — apply it, and for native crash symbols add the
356
+ NDK module at the SDK version the package pins. No `ndk.debugSymbolLevel` is
357
+ needed for Bugsee ([Native symbols](#native-symbols-android)); set one only
358
+ for what Google Play should get.
359
+
360
+ ```groovy
361
+ apply plugin: "com.android.application"
362
+ apply plugin: "org.jetbrains.kotlin.android"
363
+ apply plugin: "com.facebook.react"
364
+ apply plugin: "com.bugsee.android.gradle"
365
+
366
+ // bugseeDir as in "Android source maps" above.
367
+ def bugseeVersions = new groovy.json.JsonSlurper().parse(new File(bugseeDir, "native-versions.json"))
368
+
369
+ dependencies {
370
+ implementation "com.bugsee:bugsee-android-ndk:${bugseeVersions.android.sdk}"
371
+ }
372
+ ```
373
+
374
+ `android/bugsee.properties` (next to `android/build.gradle`; keep it out of
375
+ version control if the token is private):
376
+
377
+ ```properties
378
+ app_token=<your Android app token>
379
+ plugin.ndk.enabled=true
380
+ ```
381
+
382
+ ### Native symbols (Android)
383
+
384
+ With `plugin.ndk.enabled=true` (the config plugin writes it for a real token
385
+ unless `nativeCrashReporting` is `false`), each Release build's
386
+ `uploadBugsee<Variant>Native` task uploads native symbols. Bugsee Gradle
387
+ plugin 4.0.8 and later read them from the **unstripped** libraries AGP leaves
388
+ in `build/intermediates/merged_native_libs/<variant>`, keyed by GNU build-id,
389
+ with `bugsee-cli` 0.8.1 or later (the plugin's own floor). That makes them
390
+ independent of `ndk.debugSymbolLevel`:
391
+
392
+ - every library that still has its debug info is uploaded with it, so crash
393
+ frames get function names and `file:line`. That covers your own native
394
+ code, and React Native's `libreactnative.so`, which the Maven
395
+ `react-android` artefact ships with full DWARF. Libraries shipped stripped
396
+ (Maven Hermes's `libhermesvm.so`, the Bugsee SDK's own) get their symbol
397
+ table, function names only;
398
+ - an unchanged prebuilt library (`libreactnative.so`, `libc++_shared.so`) has
399
+ the same build-id in every release, and the server keeps one copy; a copy
400
+ stored earlier with function names only is upgraded to the full one;
401
+ - the symbols are a build artefact: nothing is added to the APK or AAB.
402
+
403
+ `debugSymbolLevel` is therefore **your app's own choice, for Google Play**
404
+ (what AGP packs into `native-debug-symbols.zip` and the AAB). The config
405
+ plugin writes none. Earlier versions of it wrote
406
+ `ndk { debugSymbolLevel 'SYMBOL_TABLE' }`, under a
407
+ `// bugsee-symbol-table:` comment, into the `debug` and `release` build
408
+ types; the next prebuild removes that block, recognised by its exact lines
409
+ only. A block you changed inside is yours: it is left as it is, and the
410
+ prebuild log says so. A level of your own is never touched.
411
+
412
+ The wrapper's own `@bugsee/cli` (source maps, dSYMs) is 0.7.12 or later.
413
+ If you pin the Gradle plugin's CLI yourself (`plugin.cliPath` or
414
+ `plugin.cliVersion`), use 0.8.1 or later: older CLIs do not read
415
+ `merged_native_libs`, and the plugin then falls back to AGP's
416
+ `native-debug-symbols.zip`, which depends on `debugSymbolLevel` (and
417
+ 0.7.0–0.7.11 send nothing for a `SYMBOL_TABLE` zip, bugsee/bugsee-cli#61).
418
+
419
+ ## iOS: bundle phase
420
+
421
+ The JS half of iOS symbolication. In Xcode, the app target's **Bundle React
422
+ Native code and images** build phase runs React Native's
423
+ `react-native-xcode.sh`. Point it at this package's `bugsee-xcode.sh`
424
+ instead, which runs React Native's script, then composes the Hermes source
425
+ map, gives the bundle and the map a debug id, and uploads the map:
426
+
427
+ ```sh
428
+ set -e
429
+
430
+ WITH_ENVIRONMENT="$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh"
431
+ REACT_NATIVE_XCODE="${SRCROOT}/../node_modules/@bugsee/react-native/scripts/bugsee-xcode.sh"
432
+
433
+ /bin/sh -c "\"$WITH_ENVIRONMENT\" \"$REACT_NATIVE_XCODE\""
434
+ ```
435
+
436
+ The upload needs a real token, from `BUGSEE_APP_TOKEN` or `BUGSEE_TOKEN_IOS`
437
+ in the build environment (for example `export BUGSEE_APP_TOKEN=…` in
438
+ `ios/.xcode.env.local`). Without one the phase bundles as usual and says it
439
+ skipped the upload; `BUGSEE_UPLOAD_SOURCEMAPS=false` turns the upload off,
440
+ and a failed upload warns without failing the build. Debug builds skip it.
441
+
442
+ Native iOS frames come from the dSYMs. The config plugin adds an Archive
443
+ post-action that uploads them with `bugsee-cli xcode post-action`; a bare app
444
+ adds the same post-action to its scheme's Archive action (the example app's
445
+ scheme, `examples/bare/ios/BareExample.xcodeproj`, is the reference). Keep its
446
+ token check: without a real token the post-action must stop, exit 0, before
447
+ it runs `bugsee-cli`, which would otherwise register the build and send the
448
+ placeholder to your endpoint, or to production when none is set.
449
+
450
+ ### React Native framework dSYMs (iOS)
451
+
452
+ React Native's prebuilt `React.xcframework` ships without dSYMs, so after an
453
+ Archive the `React` frames in a crash stay raw addresses (`React 0x10271dbc4`)
454
+ while your own and Bugsee's frames symbolicate. **Leaving this off means React
455
+ Native frames on iOS show as raw addresses.** React Native downloads the dSYMs
456
+ only when `pod install` runs with `RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS=1`:
457
+
458
+ ```sh
459
+ cd ios && RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS=1 pod install
460
+ ```
461
+
462
+ With it set, the Archive's `dSYMs/` folder includes React's dSYMs and the
463
+ post-action uploads them with the rest. A bare app has to export it wherever
464
+ it runs `pod install`, including CI.
465
+
466
+ The dSYMs are fetched together with the prebuilt `React-Core-prebuilt` pod, so
467
+ the variable does nothing for a pod that is already in `ios/Pods` (or in
468
+ CocoaPods' cache) from an earlier `pod install` without it: the log shows no
469
+ `Resolved stable dSYMs`, and the Archive has no `React.framework.dSYM`. On such
470
+ a machine remove the pod first and install again, from the app's root
471
+ directory:
472
+
473
+ ```sh
474
+ rm -rf ios/Pods/React-Core-prebuilt
475
+ pod cache clean React-Core-prebuilt --all
476
+ (cd ios && RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS=1 pod install)
477
+ ```
478
+
479
+ A fresh CI checkout is not affected. The check that it worked is the Archive's
480
+ `dSYMs/React.framework.dSYM`. With the Expo config plugin it is opt-in:
481
+
482
+ ```json
483
+ ["@bugsee/react-native", { "appToken": "…", "symbolicateReactNativeFrameworks": true }]
484
+ ```
485
+
486
+ `expo prebuild` then adds `ENV['RCT_SYMBOLICATE_PREBUILT_FRAMEWORKS'] ||= '1'`
487
+ to the top of `ios/Podfile` (Expo's Podfile reads only a fixed set of
488
+ `Podfile.properties.json` keys, so a property cannot do it), and a later
489
+ prebuild without the option removes the line again. A value you export
490
+ yourself, such as `0`, wins.
491
+
492
+ The trade-off: `pod install` makes an extra download (React Native's dSYM
493
+ tarballs). React Native fetches them in the same step as the prebuilt
494
+ framework itself, so a failed download drops the prebuilt React for that
495
+ install, and a failure while unpacking the dSYMs aborts `pod install`. That is
496
+ why the plugin leaves it off unless you ask. Apps that build React Native from
497
+ source already get its dSYMs.
498
+
499
+ Uploaded source maps list project files relative to the project root
500
+ (`/scenarios/staging.ts`), as Expo's do. The bundle phase and the Gradle hook
501
+ rewrite absolute `sources` before upload: under the project root they become
502
+ `/path/from/root`, and outside it (linked workspace packages in a monorepo)
503
+ `../path/from/root`. Entries that are already relative are left as they are. The map on disk is not changed and symbolication does not depend on
504
+ the strings.
505
+
506
+ ## Troubleshooting
507
+
508
+ **`fmt`: "call to consteval function … is not a constant expression" (iOS,
509
+ React Native 0.81 and 0.82, Xcode 26.4 or later).** Not Bugsee: React Native
510
+ 0.81 and 0.82 build `fmt` 11.0.2 from source, which newer Apple clang rejects
511
+ as C++20 ([fmtlib/fmt#4740](https://github.com/fmtlib/fmt/issues/4740)); 0.83
512
+ and later ship `fmt` 12 and are not affected. Build that one pod as C++17 from
513
+ the `post_install` in `ios/Podfile`, after `react_native_post_install(...)`,
514
+ then run `pod install` again:
515
+
516
+ ```ruby
517
+ installer.pods_project.targets.each do |target|
518
+ next unless target.name == 'fmt'
519
+ target.build_configurations.each do |config|
520
+ config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17'
521
+ end
522
+ end
523
+ ```
524
+
525
+ **`TypeError: ExceptionOptions has unknown key "labels"` (or
526
+ `"includeVideo"`).** `Bugsee.logException` takes `{ domain }` only, as the
527
+ 7.x native SDKs do, and throws on any other key before anything is sent.
528
+ Earlier betas accepted `labels` and `includeVideo`. Set labels from the
529
+ report handler instead. It has no per-call context: the labels it sets land
530
+ on every report it handles, not only on one `logException` call's.
531
+ `onAfterReportCreated` may run more than once, so set the labels rather than
532
+ append to them:
533
+
534
+ ```ts
535
+ Bugsee.setReportHandler({
536
+ onAfterReportCreated: report => report.setLabels(['checkout']),
537
+ });
538
+ ```
539
+
540
+ The handler sees only the reports that reach JavaScript. An Android NDK
541
+ relaunch never does, and an iOS report recovered at launch is best-effort;
542
+ `BugseeReportHandler` has the details.
543
+
544
+ `includeVideo` has no replacement: neither SDK can leave the video out of a
545
+ single report.
546
+
547
+ ## Examples
548
+
549
+ [`examples/playground`](https://github.com/bugsee/bugsee-react-native/tree/main/examples/playground) is a sample app with a button for every SDK API, a demo shop and a manual validation map.
550
+
551
+ ## Licence
552
+
553
+ The React Native wrapper is MIT. See [LICENSE](./LICENSE). The native Bugsee SDKs it bundles (iOS and Android) are separate packages with their own terms.