apple-ios.tsx 6.3 KB

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