apple-ios.tsx 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. import ExternalLink from 'sentry/components/links/externalLink';
  2. import List from 'sentry/components/list/';
  3. import ListItem from 'sentry/components/list/listItem';
  4. import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
  5. import type {
  6. Docs,
  7. OnboardingConfig,
  8. } from 'sentry/components/onboarding/gettingStartedDoc/types';
  9. import {appleFeedbackOnboarding} from 'sentry/gettingStartedDocs/apple/apple-macos';
  10. import {t, tct} from 'sentry/locale';
  11. const getExperimentalFeaturesSnippet = () => `
  12. import Sentry
  13. SentrySDK.start { options in
  14. // ...
  15. // Enable all experimental features
  16. options.attachViewHierarchy = true
  17. options.enablePreWarmedAppStartTracing = true
  18. options.enableMetricKit = true
  19. options.enableTimeToFullDisplayTracing = true
  20. options.swiftAsyncStacktraces = true
  21. }`;
  22. const onboarding: OnboardingConfig = {
  23. install: () => [
  24. {
  25. type: StepType.INSTALL,
  26. description: (
  27. <p>
  28. {tct(
  29. 'Add Sentry automatically to your app with the [wizardLink:Sentry wizard] (call this inside your project directory).',
  30. {
  31. wizardLink: (
  32. <ExternalLink href="https://docs.sentry.io/platforms/apple/guides/ios/#install" />
  33. ),
  34. }
  35. )}
  36. </p>
  37. ),
  38. configurations: [
  39. {
  40. language: 'bash',
  41. code: `brew install getsentry/tools/sentry-wizard && sentry-wizard -i ios`,
  42. },
  43. ],
  44. },
  45. ],
  46. configure: () => [
  47. {
  48. type: StepType.CONFIGURE,
  49. description: t('The Sentry wizard will automatically patch your application:'),
  50. configurations: [
  51. {
  52. description: (
  53. <List symbol="bullet">
  54. <ListItem>
  55. {t('Install the Sentry SDK via Swift Package Manager or Cocoapods')}
  56. </ListItem>
  57. <ListItem>
  58. {tct(
  59. 'Update your [appDelegate: AppDelegate] or SwiftUI App Initializer with the default Sentry configuration and an example error',
  60. {
  61. appDelegate: <code />,
  62. }
  63. )}
  64. </ListItem>
  65. <ListItem>
  66. {tct(
  67. 'Add a new [phase: Upload Debug Symbols] phase to your [xcodebuild: xcodebuild] build script',
  68. {
  69. phase: <code />,
  70. xcodebuild: <code />,
  71. }
  72. )}
  73. </ListItem>
  74. <ListItem>
  75. {tct(
  76. 'Create [sentryclirc: .sentryclirc] with an auth token to upload debug symbols (this file is automatically added to [gitignore: .gitignore])',
  77. {
  78. sentryclirc: <code />,
  79. gitignore: <code />,
  80. }
  81. )}
  82. </ListItem>
  83. <ListItem>
  84. {t(
  85. "When you're using Fastlane, it will add a Sentry lane for uploading debug symbols"
  86. )}
  87. </ListItem>
  88. </List>
  89. ),
  90. additionalInfo: tct(
  91. 'Alternatively, you can also [manualSetupLink:set up the SDK manually].',
  92. {
  93. manualSetupLink: (
  94. <ExternalLink href="https://docs.sentry.io/platforms/apple/guides/ios/manual-setup/" />
  95. ),
  96. stepsBelow: <strong />,
  97. }
  98. ),
  99. },
  100. ],
  101. },
  102. ],
  103. verify: () => [
  104. {
  105. type: StepType.VERIFY,
  106. description: t(
  107. '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.'
  108. ),
  109. },
  110. {
  111. title: t('Experimental Features'),
  112. description: tct(
  113. '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].',
  114. {
  115. vh: (
  116. <ExternalLink href="https://docs.sentry.io/platforms/apple/guides/ios/enriching-events/viewhierarchy/" />
  117. ),
  118. ttfd: (
  119. <ExternalLink href="https://docs.sentry.io/platforms/apple/guides/ios/performance/instrumentation/automatic-instrumentation/#time-to-full-display" />
  120. ),
  121. metricKit: (
  122. <ExternalLink href="https://docs.sentry.io/platforms/apple/guides/watchos/configuration/metric-kit/" />
  123. ),
  124. prewarmedAppStart: (
  125. <ExternalLink href="https://docs.sentry.io/platforms/apple/performance/instrumentation/automatic-instrumentation/#prewarmed-app-start-tracing" />
  126. ),
  127. asyncStacktraces: (
  128. <ExternalLink href="https://docs.sentry.io/platforms/apple/guides/ios/#stitch-together-swift-concurrency-stack-traces" />
  129. ),
  130. gh: <ExternalLink href="https://github.com/getsentry/sentry-cocoa/issues" />,
  131. break: <br />,
  132. }
  133. ),
  134. configurations: [
  135. {
  136. language: 'swift',
  137. code: getExperimentalFeaturesSnippet(),
  138. },
  139. ],
  140. },
  141. ],
  142. nextSteps: () => [
  143. {
  144. id: 'cocoapods-carthage',
  145. name: t('CocoaPods/Carthage'),
  146. description: t(
  147. 'Learn about integrating Sentry into your project using CocoaPods or Carthage.'
  148. ),
  149. link: 'https://docs.sentry.io/platforms/apple/install/',
  150. },
  151. {
  152. id: 'debug-symbols',
  153. name: t('Debug Symbols'),
  154. description: t('Symbolicate and get readable stacktraces in your Sentry errors.'),
  155. link: 'https://docs.sentry.io/platforms/apple/dsym/',
  156. },
  157. {
  158. id: 'swiftui',
  159. name: t('SwiftUI'),
  160. description: t('Learn about our first class integration with SwiftUI.'),
  161. link: 'https://docs.sentry.io/platforms/apple/performance/instrumentation/swiftui-instrumentation/',
  162. },
  163. {
  164. id: 'profiling',
  165. name: t('Profiling'),
  166. description: t(
  167. 'Collect and analyze performance profiles from real user devices in production.'
  168. ),
  169. link: 'https://docs.sentry.io/platforms/apple/profiling/',
  170. },
  171. ],
  172. };
  173. const docs: Docs = {
  174. onboarding,
  175. feedbackOnboardingCrashApi: appleFeedbackOnboarding,
  176. crashReportOnboarding: appleFeedbackOnboarding,
  177. };
  178. export default docs;