ios.tsx 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  1. import ExternalLink from 'sentry/components/links/externalLink';
  2. import Link from 'sentry/components/links/link';
  3. import List from 'sentry/components/list/';
  4. import ListItem from 'sentry/components/list/listItem';
  5. import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
  6. import type {
  7. BasePlatformOptions,
  8. Docs,
  9. DocsParams,
  10. OnboardingConfig,
  11. } from 'sentry/components/onboarding/gettingStartedDoc/types';
  12. import {metricTagsExplanation} from 'sentry/components/onboarding/gettingStartedDoc/utils/metricsOnboarding';
  13. import {
  14. getReplayMobileConfigureDescription,
  15. getReplayVerifyStep,
  16. } from 'sentry/components/onboarding/gettingStartedDoc/utils/replayOnboarding';
  17. import {appleFeedbackOnboarding} from 'sentry/gettingStartedDocs/apple/macos';
  18. import {t, tct} from 'sentry/locale';
  19. import {getPackageVersion} from 'sentry/utils/gettingStartedDocs/getPackageVersion';
  20. export enum InstallationMode {
  21. AUTO = 'auto',
  22. MANUAL = 'manual',
  23. }
  24. const platformOptions = {
  25. installationMode: {
  26. label: t('Installation Mode'),
  27. items: [
  28. {
  29. label: t('Auto'),
  30. value: InstallationMode.AUTO,
  31. },
  32. {
  33. label: t('Manual'),
  34. value: InstallationMode.MANUAL,
  35. },
  36. ],
  37. defaultValue:
  38. navigator.userAgent.indexOf('Win') !== -1
  39. ? InstallationMode.MANUAL
  40. : InstallationMode.AUTO,
  41. },
  42. } satisfies BasePlatformOptions;
  43. type PlatformOptions = typeof platformOptions;
  44. type Params = DocsParams<PlatformOptions>;
  45. const isAutoInstall = (params: Params) =>
  46. params.platformOptions.installationMode === InstallationMode.AUTO;
  47. const getAutoInstallSnippet = () =>
  48. `brew install getsentry/tools/sentry-wizard && sentry-wizard -i ios`;
  49. const getManualInstallSnippet = (params: Params) => `
  50. .package(url: "https://github.com/getsentry/sentry-cocoa", from: "${getPackageVersion(
  51. params,
  52. 'sentry.cocoa',
  53. '8.9.3'
  54. )}"),`;
  55. const getConfigurationSnippet = (params: Params) => `
  56. import Sentry
  57. // ....
  58. func application(_ application: UIApplication,
  59. didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
  60. SentrySDK.start { options in
  61. options.dsn = "${params.dsn.public}"
  62. options.debug = true // Enabling debug when first installing is always helpful${
  63. params.isPerformanceSelected
  64. ? `
  65. // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.
  66. // We recommend adjusting this value in production.
  67. options.tracesSampleRate = 1.0`
  68. : ''
  69. }${
  70. params.isProfilingSelected &&
  71. params.profilingOptions?.defaultProfilingMode !== 'continuous'
  72. ? `
  73. // Sample rate for profiling, applied on top of TracesSampleRate.
  74. // We recommend adjusting this value in production.
  75. options.profilesSampleRate = 1.0`
  76. : ''
  77. }
  78. }${
  79. params.isProfilingSelected &&
  80. params.profilingOptions?.defaultProfilingMode === 'continuous'
  81. ? `
  82. // Manually call startProfiler and stopProfiler
  83. // to profile the code in between
  84. SentrySDK.startProfiler()
  85. // this code will be profiled
  86. //
  87. // Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling
  88. // your application until the process exits or stopProfiler is called.
  89. SentrySDK.stopProfiler()`
  90. : ''
  91. }
  92. return true
  93. }`;
  94. const getConfigurationSnippetSwiftUi = (params: Params) => `
  95. import Sentry
  96. @main
  97. struct SwiftUIApp: App {
  98. init() {
  99. SentrySDK.start { options in
  100. options.dsn = "${params.dsn.public}"
  101. options.debug = true // Enabling debug when first installing is always helpful${
  102. params.isPerformanceSelected
  103. ? `
  104. // Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.
  105. // We recommend adjusting this value in production.
  106. options.tracesSampleRate = 1.0`
  107. : ''
  108. }${
  109. params.isProfilingSelected &&
  110. params.profilingOptions?.defaultProfilingMode !== 'continuous'
  111. ? `
  112. // Sample rate for profiling, applied on top of TracesSampleRate.
  113. // We recommend adjusting this value in production.
  114. options.profilesSampleRate = 1.0`
  115. : ''
  116. }
  117. }${
  118. params.isProfilingSelected &&
  119. params.profilingOptions?.defaultProfilingMode === 'continuous'
  120. ? `
  121. // Manually call startProfiler and stopProfiler
  122. // to profile the code in between
  123. SentrySDK.startProfiler()
  124. // this code will be profiled
  125. //
  126. // Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling
  127. // your application until the process exits or stopProfiler is called.
  128. SentrySDK.stopProfiler()`
  129. : ''
  130. }
  131. }
  132. }`;
  133. const getVerifySnippet = () => `
  134. let button = UIButton(type: .roundedRect)
  135. button.frame = CGRect(x: 20, y: 50, width: 100, height: 30)
  136. button.setTitle("Break the world", for: [])
  137. button.addTarget(self, action: #selector(self.breakTheWorld(_:)), for: .touchUpInside)
  138. view.addSubview(button)
  139. @IBAction func breakTheWorld(_ sender: AnyObject) {
  140. fatalError("Break the world")
  141. }`;
  142. const getExperimentalFeaturesSnippetSwift = () => `
  143. import Sentry
  144. SentrySDK.start { options in
  145. // ...
  146. // Enable all experimental features
  147. options.attachViewHierarchy = true
  148. options.enableMetricKit = true
  149. options.enableTimeToFullDisplayTracing = true
  150. options.swiftAsyncStacktraces = true
  151. options.enableAppLaunchProfiling = true
  152. }`;
  153. const getExperimentalFeaturesSnippetObjC = () => `
  154. @import Sentry;
  155. [SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
  156. // ...
  157. // Enable all experimental features
  158. options.attachViewHierarchy = YES;
  159. options.enableMetricKit = YES;
  160. options.enableTimeToFullDisplayTracing = YES;
  161. options.swiftAsyncStacktraces = YES;
  162. options.enableAppLaunchProfiling = YES;
  163. }];`;
  164. const getConfigureMetricsSnippetSwift = (params: Params) => `
  165. import Sentry
  166. SentrySDK.start { options in
  167. options.dsn = "${params.dsn.public}"
  168. options.enableMetrics = true
  169. }`;
  170. const getConfigureMetricsSnippetObjC = (params: Params) => `
  171. @import Sentry;
  172. [SentrySDK startWithConfigureOptions:^(SentryOptions * options) {
  173. options.Dsn = @"${params.dsn.public}";
  174. options.enableMetrics = YES;
  175. }];`;
  176. const getVerifyMetricsSnippetSwift = () => `
  177. import Sentry
  178. // Incrementing a counter by one for each button click.
  179. SentrySDK.metrics
  180. .increment(key: "button_login_click",
  181. value: 1.0,
  182. tags: ["screen": "login"]
  183. )
  184. // Add '150' to a distribution used to track the loading time.
  185. SentrySDK.metrics
  186. .distribution(key: "image_download_duration",
  187. value: 150.0,
  188. unit: MeasurementUnitDuration.millisecond,
  189. tags: ["screen": "login"]
  190. )
  191. // Adding '1' to a gauge used to track the loading time.
  192. SentrySDK.metrics
  193. .gauge(key: "page_load",
  194. value: 1.0,
  195. unit: MeasurementUnitDuration.millisecond,
  196. tags: ["screen": "login"]
  197. )
  198. // Add 'jane' to a set
  199. // used for tracking the number of users that viewed a page.
  200. SentrySDK.metrics
  201. .set(key: "user_view",
  202. value: "jane",
  203. unit: MeasurementUnit(unit: "username"),
  204. tags: ["screen": "login"]
  205. )`;
  206. const getVerifyMetricsSnippetObjC = () => `
  207. @import Sentry;
  208. // Incrementing a counter by one for each button click.
  209. [SentrySDK.metrics
  210. incrementWithKey :@"button_login_click"
  211. value: 1.0
  212. unit: SentryMeasurementUnit.none
  213. tags: @{ @"screen" : @"login" }
  214. ];
  215. // Add '150' to a distribution used to track the loading time.
  216. [SentrySDK.metrics
  217. distributionWithKey: @"image_download_duration"
  218. value: 150.0
  219. unit: SentryMeasurementUnitDuration.millisecond
  220. tags: @{ @"screen" : @"login" }
  221. ];
  222. // Adding '1' to a gauge used to track the loading time.
  223. [SentrySDK.metrics
  224. gaugeWithKey: @"page_load"
  225. value: 1.0
  226. unit: SentryMeasurementUnitDuration.millisecond
  227. tags: @{ @"screen" : @"login" }
  228. ];
  229. // Add 'jane' to a set
  230. // used for tracking the number of users that viewed a page.
  231. [SentrySDK.metrics
  232. setWithKey :@"user_view"
  233. value: @"jane"
  234. unit: [[SentryMeasurementUnit alloc] initWithUnit:@"username"]
  235. tags: @{ @"screen" : @"login" }
  236. ];`;
  237. const getReplaySetupSnippet = (params: Params) => `
  238. SentrySDK.start(configureOptions: { options in
  239. options.dsn = "${params.dsn.public}"
  240. options.debug = true
  241. options.sessionReplay.onErrorSampleRate = 1.0
  242. options.sessionReplay.sessionSampleRate = 0.1
  243. })`;
  244. const getReplayConfigurationSnippet = () => `
  245. options.sessionReplay.redactAllText = true
  246. options.sessionReplay.redactAllImages = true`;
  247. const onboarding: OnboardingConfig<PlatformOptions> = {
  248. install: params =>
  249. isAutoInstall(params)
  250. ? [
  251. {
  252. type: StepType.INSTALL,
  253. description: (
  254. <p>
  255. {tct(
  256. 'Add Sentry automatically to your app with the [wizardLink:Sentry wizard] (call this inside your project directory).',
  257. {
  258. wizardLink: (
  259. <ExternalLink href="https://docs.sentry.io/platforms/apple/guides/ios/#install" />
  260. ),
  261. }
  262. )}
  263. </p>
  264. ),
  265. configurations: [
  266. {
  267. language: 'bash',
  268. code: getAutoInstallSnippet(),
  269. },
  270. ],
  271. },
  272. ]
  273. : [
  274. {
  275. type: StepType.INSTALL,
  276. description: tct(
  277. 'We recommend installing the SDK with Swift Package Manager (SPM), but we also support [alternateMethods: alternate installation methods]. To integrate Sentry into your Xcode project using SPM, open your App in Xcode and open [addPackage: File > Add Packages]. Then add the SDK by entering the Git repo url in the top right search field:',
  278. {
  279. alternateMethods: (
  280. <ExternalLink href="https://docs.sentry.io/platforms/apple/install/" />
  281. ),
  282. addPackage: <strong />,
  283. }
  284. ),
  285. configurations: [
  286. {
  287. language: 'url',
  288. code: `https://github.com/getsentry/sentry-cocoa.git`,
  289. },
  290. {
  291. description: (
  292. <p>
  293. {tct(
  294. 'Alternatively, when your project uses a [packageSwift: Package.swift] file to manage dependencies, you can specify the target with:',
  295. {
  296. packageSwift: <code />,
  297. }
  298. )}
  299. </p>
  300. ),
  301. language: 'swift',
  302. partialLoading: params.sourcePackageRegistries.isLoading,
  303. code: getManualInstallSnippet(params),
  304. },
  305. ],
  306. },
  307. ],
  308. configure: params =>
  309. isAutoInstall(params)
  310. ? [
  311. {
  312. type: StepType.CONFIGURE,
  313. description: t(
  314. 'The Sentry wizard will automatically patch your application:'
  315. ),
  316. configurations: [
  317. {
  318. description: (
  319. <List symbol="bullet">
  320. <ListItem>
  321. {t('Install the Sentry SDK via Swift Package Manager or Cocoapods')}
  322. </ListItem>
  323. <ListItem>
  324. {tct(
  325. 'Update your [appDelegate: AppDelegate] or SwiftUI App Initializer with the default Sentry configuration and an example error',
  326. {
  327. appDelegate: <code />,
  328. }
  329. )}
  330. </ListItem>
  331. <ListItem>
  332. {tct(
  333. 'Add a new [code: Upload Debug Symbols] phase to your [code: xcodebuild] build script',
  334. {
  335. code: <code />,
  336. }
  337. )}
  338. </ListItem>
  339. <ListItem>
  340. {tct(
  341. 'Create [code: .sentryclirc] with an auth token to upload debug symbols (this file is automatically added to [code: .gitignore])',
  342. {
  343. code: <code />,
  344. }
  345. )}
  346. </ListItem>
  347. <ListItem>
  348. {t(
  349. "When you're using Fastlane, it will add a Sentry lane for uploading debug symbols"
  350. )}
  351. </ListItem>
  352. </List>
  353. ),
  354. additionalInfo: tct(
  355. 'Alternatively, you can also [manualSetupLink:set up the SDK manually].',
  356. {
  357. manualSetupLink: (
  358. <ExternalLink href="https://docs.sentry.io/platforms/apple/guides/ios/manual-setup/" />
  359. ),
  360. stepsBelow: <strong />,
  361. }
  362. ),
  363. },
  364. ],
  365. },
  366. ]
  367. : [
  368. {
  369. type: StepType.CONFIGURE,
  370. description: (
  371. <p>
  372. {tct(
  373. 'Make sure you initialize the SDK as soon as possible in your application lifecycle e.g. in your [appDelegate:] method:',
  374. {
  375. appDelegate: (
  376. <code>
  377. - [UIAppDelegate application:didFinishLaunchingWithOptions:]
  378. </code>
  379. ),
  380. }
  381. )}
  382. </p>
  383. ),
  384. configurations: [
  385. {
  386. language: 'swift',
  387. code: getConfigurationSnippet(params),
  388. },
  389. {
  390. description: (
  391. <p>
  392. {tct(
  393. "When using SwiftUI and your app doesn't implement an app delegate, initialize the SDK within the [initializer: App conformer's initializer]:",
  394. {
  395. initializer: (
  396. <ExternalLink href="https://developer.apple.com/documentation/swiftui/app/main()" />
  397. ),
  398. }
  399. )}
  400. </p>
  401. ),
  402. language: 'swift',
  403. code: getConfigurationSnippetSwiftUi(params),
  404. },
  405. ],
  406. },
  407. ],
  408. verify: params =>
  409. isAutoInstall(params)
  410. ? [
  411. {
  412. type: StepType.VERIFY,
  413. description: t(
  414. 'The Sentry wizard automatically adds a code snippet that captures a message to your project. Simply run your app and you should see this message in your Sentry project.'
  415. ),
  416. },
  417. {
  418. title: t('Experimental Features'),
  419. description: tct(
  420. 'Want to play with some new features? Try out our experimental features for [vh: View Hierarchy], [ttfd: Time to Full Display (TTFD)], [metricKit: MetricKit], [prewarmedAppStart: Prewarmed App Start Tracing], and [asyncStacktraces: Swift Async Stacktraces]. Experimental features are still a work-in-progress and may have bugs. We recognize the irony. [break] Let us know if you have feedback through [gh: GitHub issues].',
  421. {
  422. vh: (
  423. <ExternalLink href="https://docs.sentry.io/platforms/apple/guides/ios/enriching-events/viewhierarchy/" />
  424. ),
  425. ttfd: (
  426. <ExternalLink href="https://docs.sentry.io/platforms/apple/guides/ios/tracing/instrumentation/automatic-instrumentation/#time-to-full-display" />
  427. ),
  428. metricKit: (
  429. <ExternalLink href="https://docs.sentry.io/platforms/apple/guides/watchos/configuration/metric-kit/" />
  430. ),
  431. prewarmedAppStart: (
  432. <ExternalLink href="https://docs.sentry.io/platforms/apple/tracing/instrumentation/automatic-instrumentation/#prewarmed-app-start-tracing" />
  433. ),
  434. asyncStacktraces: (
  435. <ExternalLink href="https://docs.sentry.io/platforms/apple/guides/ios/#stitch-together-swift-concurrency-stack-traces" />
  436. ),
  437. gh: (
  438. <ExternalLink href="https://github.com/getsentry/sentry-cocoa/issues" />
  439. ),
  440. break: <br />,
  441. }
  442. ),
  443. configurations: [
  444. {
  445. code: [
  446. {
  447. label: 'Swift',
  448. value: 'swift',
  449. language: 'swift',
  450. code: getExperimentalFeaturesSnippetSwift(),
  451. },
  452. {
  453. label: 'Objective-C',
  454. value: 'c',
  455. language: 'c',
  456. code: getExperimentalFeaturesSnippetObjC(),
  457. },
  458. ],
  459. },
  460. ],
  461. },
  462. ]
  463. : [
  464. {
  465. type: StepType.VERIFY,
  466. description: (
  467. <p>
  468. {tct(
  469. 'This snippet contains an intentional error you can use to test that errors are uploaded to Sentry correctly. You can add it to your main [viewController: ViewController].',
  470. {
  471. viewController: <code />,
  472. }
  473. )}
  474. </p>
  475. ),
  476. configurations: [
  477. {
  478. language: 'swift',
  479. code: getVerifySnippet(),
  480. },
  481. ],
  482. },
  483. ],
  484. nextSteps: () => [
  485. {
  486. id: 'cocoapods-carthage',
  487. name: t('CocoaPods/Carthage'),
  488. description: t(
  489. 'Learn about integrating Sentry into your project using CocoaPods or Carthage.'
  490. ),
  491. link: 'https://docs.sentry.io/platforms/apple/install/',
  492. },
  493. {
  494. id: 'debug-symbols',
  495. name: t('Debug Symbols'),
  496. description: t('Symbolicate and get readable stacktraces in your Sentry errors.'),
  497. link: 'https://docs.sentry.io/platforms/apple/dsym/',
  498. },
  499. {
  500. id: 'swiftui',
  501. name: t('SwiftUI'),
  502. description: t('Learn about our first class integration with SwiftUI.'),
  503. link: 'https://docs.sentry.io/platforms/apple/tracing/instrumentation/swiftui-instrumentation/',
  504. },
  505. ],
  506. };
  507. const metricsOnboarding: OnboardingConfig<PlatformOptions> = {
  508. install: (params: Params) => [
  509. {
  510. type: StepType.INSTALL,
  511. description: tct(
  512. 'You need Sentry Cocoa SDK version [codeVersion:8.23.0] or higher. Learn more about installation methods in our [docsLink:full documentation].',
  513. {
  514. codeVersion: <code />,
  515. docsLink: <Link to={`/projects/${params.projectSlug}/getting-started/`} />,
  516. }
  517. ),
  518. configurations: [
  519. {
  520. language: 'yml',
  521. partialLoading: params.sourcePackageRegistries?.isLoading,
  522. code: getAutoInstallSnippet(),
  523. },
  524. ],
  525. },
  526. ],
  527. configure: (params: Params) => [
  528. {
  529. type: StepType.CONFIGURE,
  530. description: t(
  531. 'To enable capturing metrics, you need to enable the metrics feature.'
  532. ),
  533. configurations: [
  534. {
  535. code: [
  536. {
  537. label: 'Swift',
  538. value: 'swift',
  539. language: 'swift',
  540. code: getConfigureMetricsSnippetSwift(params),
  541. },
  542. {
  543. label: 'Objective-C',
  544. value: 'c',
  545. language: 'c',
  546. code: getConfigureMetricsSnippetObjC(params),
  547. },
  548. ],
  549. },
  550. ],
  551. },
  552. ],
  553. verify: () => [
  554. {
  555. type: StepType.VERIFY,
  556. description: tct(
  557. "Then you'll be able to add metrics as [code:counters], [code:sets], [code:distributions], and [code:gauges]. These are available under the [code:SentrySDK.metrics()] namespace.",
  558. {
  559. code: <code />,
  560. }
  561. ),
  562. configurations: [
  563. {
  564. description: metricTagsExplanation,
  565. },
  566. {
  567. description: t('Try out these examples:'),
  568. code: [
  569. {
  570. label: 'Swift',
  571. value: 'swift',
  572. language: 'swift',
  573. code: getVerifyMetricsSnippetSwift(),
  574. },
  575. {
  576. label: 'Objective-C',
  577. value: 'c',
  578. language: 'c',
  579. code: getVerifyMetricsSnippetObjC(),
  580. },
  581. ],
  582. },
  583. {
  584. description: t(
  585. 'It can take up to 3 minutes for the data to appear in the Sentry UI.'
  586. ),
  587. },
  588. {
  589. description: tct(
  590. 'Learn more about metrics and how to configure them, by reading the [docsLink:docs].',
  591. {
  592. docsLink: (
  593. <ExternalLink href="https://docs.sentry.io/platforms/apple/metrics/" />
  594. ),
  595. }
  596. ),
  597. },
  598. ],
  599. },
  600. ],
  601. };
  602. const replayOnboarding: OnboardingConfig<PlatformOptions> = {
  603. install: (params: Params) => [
  604. {
  605. type: StepType.INSTALL,
  606. description: t(
  607. 'Make sure your Sentry Cocoa SDK version is at least 8.43.0. If you already have the SDK installed, you can update it to the latest version with:'
  608. ),
  609. configurations: [
  610. {
  611. code: [
  612. {
  613. label: 'SPM',
  614. value: 'spm',
  615. language: 'swift',
  616. code: `.package(url: "https://github.com/getsentry/sentry-cocoa", from: "${getPackageVersion(
  617. params,
  618. 'sentry.cocoa',
  619. '8.36.0'
  620. )}"),`,
  621. },
  622. {
  623. label: 'CocoaPods',
  624. value: 'cocoapods',
  625. language: 'ruby',
  626. code: `pod update`,
  627. },
  628. {
  629. label: 'Carthage',
  630. value: 'carthage',
  631. language: 'swift',
  632. code: `github "getsentry/sentry-cocoa" "${getPackageVersion(
  633. params,
  634. 'sentry.cocoa',
  635. '8.36.0'
  636. )}"`,
  637. },
  638. ],
  639. },
  640. {
  641. description: t(
  642. 'To set up the integration, add the following to your Sentry initialization:'
  643. ),
  644. },
  645. {
  646. code: [
  647. {
  648. label: 'Swift',
  649. value: 'swift',
  650. language: 'swift',
  651. code: getReplaySetupSnippet(params),
  652. },
  653. ],
  654. },
  655. ],
  656. },
  657. ],
  658. configure: () => [
  659. {
  660. type: StepType.CONFIGURE,
  661. description: getReplayMobileConfigureDescription({
  662. link: 'https://docs.sentry.io/platforms/apple/guides/ios/session-replay/#privacy',
  663. }),
  664. configurations: [
  665. {
  666. description: t(
  667. 'The following code is the default configuration, which masks and blocks everything.'
  668. ),
  669. code: [
  670. {
  671. label: 'Swift',
  672. value: 'swift',
  673. language: 'swift',
  674. code: getReplayConfigurationSnippet(),
  675. },
  676. ],
  677. },
  678. ],
  679. },
  680. ],
  681. verify: getReplayVerifyStep({
  682. replayOnErrorSampleRateName: 'options\u200b.sessionReplay\u200b.onErrorSampleRate',
  683. replaySessionSampleRateName: 'options\u200b.sessionReplay\u200b.sessionSampleRate',
  684. }),
  685. nextSteps: () => [],
  686. };
  687. const docs: Docs<PlatformOptions> = {
  688. onboarding,
  689. feedbackOnboardingCrashApi: appleFeedbackOnboarding,
  690. crashReportOnboarding: appleFeedbackOnboarding,
  691. customMetricsOnboarding: metricsOnboarding,
  692. platformOptions,
  693. replayOnboarding,
  694. };
  695. export default docs;