Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/platforms/android/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ Select which Sentry features you'd like to install in addition to Error Monitori

Sentry captures data by using an SDK within your application's runtime. These are platform-specific and allow Sentry to have a deep understanding of how your application works.

In addition to capturing errors, you can monitor interactions between multiple services or applications by [enabling tracing](https://docs.sentry.io/concepts/key-terms/tracing/). You can also collect and analyze performance profiles from real users with [profiling](https://docs.sentry.io/product/explore/profiling/). To enable tracing and/or profiling, click the corresponding checkmarks to get the code snippets.

We recommend installing the SDK through our [Sentry Wizard](https://github.com/getsentry/sentry-wizard) by running the following command inside your project directory:

```bash
Expand Down
128 changes: 101 additions & 27 deletions docs/platforms/apple/common/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,36 @@ The support for [visionOS](https://developer.apple.com/visionos/) is currently e

## Features

<PlatformSection notSupported={["apple.tvos", "apple.watchos", "apple.visionos"]}>

In addition to capturing errors, you can monitor interactions between multiple services or applications by [enabling tracing](/concepts/key-terms/tracing/). You can also collect and analyze performance profiles from real users with [profiling](/product/explore/profiling/).

</PlatformSection>

<PlatformSection notSupported={["apple.ios", "apple.macos"]}>

In addition to capturing errors, you can monitor interactions between multiple services or applications by [enabling tracing](/concepts/key-terms/tracing/).

</PlatformSection>

Select which Sentry features you'd like to install in addition to Error Monitoring to get the corresponding installation and configuration instructions below.

## Install

<OnboardingOptionButtons
options={[
'error-monitoring',
'performance',
'profiling',
]}
/>
<PlatformSection notSupported={["apple.tvos", "apple.watchos", "apple.visionos"]}>

Sentry captures data by using an SDK within your application's runtime. These are platform-specific and allow Sentry to have a deep understanding of how your application works.
<OnboardingOptionButtons options={['error-monitoring', 'performance', 'profiling']}/>

</PlatformSection>

<PlatformSection notSupported={["apple.ios", "apple.macos"]}>

<OnboardingOptionButtons options={['error-monitoring', 'performance']}/>

</PlatformSection>

In addition to capturing errors, you can monitor interactions between multiple services or applications by [enabling tracing](https://docs.sentry.io/concepts/key-terms/tracing/). You can also collect and analyze performance profiles from real users with [profiling](https://docs.sentry.io/product/profiling/). To enable tracing and/or profiling, click the corresponding checkmarks to get the code snippets.

Sentry captures data by using an SDK within your application's runtime. These are platform-specific and allow Sentry to have a deep understanding of how your application works.

<PlatformSection notSupported={["apple.ios"]}>

Expand Down Expand Up @@ -72,8 +85,9 @@ If you prefer, you can also [set up the SDK manually](/platforms/apple/guides/io

To capture all errors, initialize the SDK as soon as possible, such as in your `AppDelegate` `application:didFinishLaunchingWithOptions` method:

<PlatformSection notSupported={["apple.tvos", "apple.watchos", "apple.visionos"]}>

```swift {tabTitle:Swift} {"onboardingOptions": {"performance": "9-12", "profiling": "13-16"}}
```swift {tabTitle:Swift} {"onboardingOptions": {"performance": "9-12", "profiling": "14-24"}}
import Sentry

func application(_ application: UIApplication,
Expand All @@ -88,22 +102,22 @@ func application(_ application: UIApplication,
options.tracesSampleRate = 1.0
}

// Manually call startProfiler and stopProfiler to profile any code that runs in between.
SentrySDK.startProfiler()
// Manually call startProfiler and stopProfiler to profile any code that runs in between.
SentrySDK.startProfiler()

//
// ...anything here will be profiled...
//
//
// ...anything here will be profiled...
//

// Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling
// your application until the process exits, the app goes to the background, or stopProfiling is called.
SentrySDK.stopProfiler()
// Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling
// your application until the process exits, the app goes to the background, or stopProfiling is called.
SentrySDK.stopProfiler()

return true
}
```

```objc {tabTitle:Objective-C} {"onboardingOptions": {"performance": "8-11", "profiling": "12-15"}}
```objc {tabTitle:Objective-C} {"onboardingOptions": {"performance": "8-11", "profiling": "13-23"}}
@import Sentry;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
Expand All @@ -117,16 +131,16 @@ func application(_ application: UIApplication,
options.tracesSampleRate = @1.0;
}];

// Manually call startProfiler and stopProfiler to profile any code that runs in between.
[SentrySDK startProfiler];
// Manually call startProfiler and stopProfiler to profile any code that runs in between.
[SentrySDK startProfiler];

//
// ...anything here will be profiled...
//
//
// ...anything here will be profiled...
//

// Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling
// your application until the process exits, the app goes to the background, or stopProfiling is called.
[SentrySDK stopProfiler];
// Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling
// your application until the process exits, the app goes to the background, or stopProfiling is called.
[SentrySDK stopProfiler];

return YES;
}
Expand All @@ -153,6 +167,66 @@ struct SwiftUIApp: App {
}
}
```
</PlatformSection>

<PlatformSection notSupported={["apple.ios", "apple.macos"]}>

```swift {tabTitle:Swift} {"onboardingOptions": {"performance": "9-12"}}
import Sentry

func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

SentrySDK.start { options in
options.dsn = "___PUBLIC_DSN___"
options.debug = true // Enabled debug when first installing is always helpful

// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
// We recommend adjusting this value in production.
options.tracesSampleRate = 1.0
}

return true
}
```

```objc {tabTitle:Objective-C} {"onboardingOptions": {"performance": "8-11"}}
@import Sentry;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

[SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
options.dsn = @"___PUBLIC_DSN___";
options.debug = YES; // Enabled debug when first installing is always helpful

// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
// We recommend adjusting this value in production.
options.tracesSampleRate = @1.0;
}];

return YES;
}
```

```swift {tabTitle:SwiftUI with App conformer} {"onboardingOptions": {"performance": "9-12"}}
import Sentry

@main
struct SwiftUIApp: App {
init() {
SentrySDK.start { options in
options.dsn = "___PUBLIC_DSN___"
options.debug = true // Enabled debug when first installing is always helpful

// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
// We recommend adjusting this value in production.
options.tracesSampleRate = 1.0
}
}
}
```

</PlatformSection>

## Verify

Expand Down
Loading