Skip to content
Draft
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
5 changes: 1 addition & 4 deletions docs/onboarding/error-tracking/ios.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import { StepDefinition } from '../steps'
export const getIOSSteps = (ctx: OnboardingComponentsContext): StepDefinition[] => {
const { CodeBlock, Markdown, CalloutBox, dedent } = ctx

const installSteps = getIOSStepsPA(ctx, {
minVersionPod: '3.56',
minVersionSPM: '3.56.0',
})
const installSteps = getIOSStepsPA(ctx)

const exceptionAutocaptureStep: StepDefinition = {
title: 'Set up exception autocapture',
Expand Down
5 changes: 1 addition & 4 deletions docs/onboarding/logs/ios.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import { StepDefinition } from '../steps'
export const getIOSSteps = (ctx: OnboardingComponentsContext): StepDefinition[] => {
const { CodeBlock, Markdown, dedent } = ctx

const installSteps = getIOSStepsPA(ctx, {
minVersionPod: '3.58',
minVersionSPM: '3.58.0',
})
const installSteps = getIOSStepsPA(ctx)

const sendLogStep: StepDefinition = {
title: 'Send a log',
Expand Down
57 changes: 17 additions & 40 deletions docs/onboarding/product-analytics/ios.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,39 @@ import { OnboardingComponentsContext, createInstallation } from 'scenes/onboardi

import { StepDefinition } from '../steps'

export const getIOSInstallSteps = (
ctx: OnboardingComponentsContext,
options?: {
includeExperimentalSpi?: boolean
experimentalDescription?: string
minVersionPod?: string
minVersionSPM?: string
}
): StepDefinition[] => {
export const getIOSInstallSteps = (ctx: OnboardingComponentsContext): StepDefinition[] => {
const { CodeBlock, Markdown, CalloutBox, dedent } = ctx

const podVersion = options?.minVersionPod || '3.56'
const spmVersion = options?.minVersionSPM || '3.56.0'

return [
{
title: 'Install dependency',
badge: 'required',
content: (
<>
{options?.experimentalDescription && (
<CalloutBox type="fyi" title="Experimental API">
<Markdown>{options.experimentalDescription}</Markdown>
</CalloutBox>
)}
<Markdown>Install via Swift Package Manager:</Markdown>
<Markdown>
Install via Swift Package Manager. PostHog requires Xcode 26 or later, and iOS 15, macOS 11,
tvOS 15, watchOS 10, or visionOS 1 or later.
</Markdown>
<CodeBlock
blocks={[
{
language: 'swift',
file: 'Package.swift',
code: dedent`
dependencies: [
.package(url: "https://github.com/PostHog/posthog-ios.git", from: "${spmVersion}")
.package(url: "https://github.com/PostHog/posthog-ios.git", from: "4.0.0")
]
`,
},
]}
/>
<Markdown>Or add PostHog to your Podfile:</Markdown>
<CodeBlock
blocks={[
<CalloutBox type="fyi" title="Using CocoaPods?">
<Markdown>
{
language: 'ruby',
file: 'Podfile',
code: dedent`
pod "PostHog", "~> ${podVersion}"
`,
},
]}
/>
'Version 4 is only published to Swift Package Manager. Version 3 stays on CocoaPods (`pod "PostHog", "~> 3.0"`), but [CocoaPods trunk becomes read-only on December 2, 2026](https://blog.cocoapods.org/CocoaPods-Specs-Repo/). After that, existing 3.x versions stay installable, but new releases only ship through Swift Package Manager. To switch, see the [iOS migration guide](https://posthog.com/docs/libraries/ios/migration).'
}
</Markdown>
</CalloutBox>
</>
),
},
Expand All @@ -69,7 +51,7 @@ export const getIOSInstallSteps = (
file: 'AppDelegate.swift',
code: dedent`
import Foundation
${options?.includeExperimentalSpi ? '@_spi(Experimental) ' : ''}import PostHog
import PostHog
import UIKit

class AppDelegate: NSObject, UIApplicationDelegate {
Expand Down Expand Up @@ -121,14 +103,9 @@ export const getIOSEventStep = (ctx: OnboardingComponentsContext): StepDefinitio
}
}

export const getIOSSteps = (
ctx: OnboardingComponentsContext,
options?: {
includeExperimentalSpi?: boolean
experimentalDescription?: string
minVersionPod?: string
minVersionSPM?: string
}
): StepDefinition[] => [...getIOSInstallSteps(ctx, options), getIOSEventStep(ctx)]
export const getIOSSteps = (ctx: OnboardingComponentsContext): StepDefinition[] => [
...getIOSInstallSteps(ctx),
getIOSEventStep(ctx),
]

export const IOSInstallation = createInstallation(getIOSSteps)
55 changes: 26 additions & 29 deletions docs/onboarding/session-replay/ios.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,28 @@ export const getIOSSteps = (ctx: OnboardingComponentsContext): StepDefinition[]
badge: 'required',
content: (
<>
<Markdown>Add PostHog to your Podfile:</Markdown>
<CodeBlock
blocks={[
{
language: 'ruby',
file: 'Podfile',
code: dedent`
pod "PostHog", "~> 3.56"
`,
},
]}
/>
<Markdown>Or install via Swift Package Manager:</Markdown>
<Markdown>
Comment thread
turnipdabeets marked this conversation as resolved.
Resolved
Install via Swift Package Manager. PostHog requires Xcode 26 or later, and iOS 15, macOS 11,
tvOS 15, watchOS 10, or visionOS 1 or later.
</Markdown>
<CodeBlock
blocks={[
{
language: 'swift',
file: 'Package.swift',
code: dedent`
dependencies: [
.package(url: "https://github.com/PostHog/posthog-ios.git", from: "3.56.0")
.package(url: "https://github.com/PostHog/posthog-ios.git", from: "4.0.0")
]
`,
},
]}
/>
<CalloutBox type="fyi" title="SDK version">
<CalloutBox type="fyi" title="Using CocoaPods?">
<Markdown>
Session replay requires PostHog iOS SDK version 3.6.0 or higher. We recommend always using
the latest version.
{
'Version 4 is only published to Swift Package Manager. Version 3 stays on CocoaPods (`pod "PostHog", "~> 3.0"`), but [CocoaPods trunk becomes read-only on December 2, 2026](https://blog.cocoapods.org/CocoaPods-Specs-Repo/). After that, existing 3.x versions stay installable, but new releases only ship through Swift Package Manager. To switch, see the [iOS migration guide](https://posthog.com/docs/libraries/ios/migration).'
}
</Markdown>
</CalloutBox>
</>
Expand Down Expand Up @@ -111,25 +103,29 @@ export const getIOSSteps = (ctx: OnboardingComponentsContext): StepDefinition[]
// requires SDK version 3.41.1 or higher.
config.sessionReplayConfig.captureNetworkTelemetry = true

// Whether replays are created using high quality screenshots. Default is false.
// Required for SwiftUI.
// If disabled, replays are created using wireframes instead.
// The screenshot may contain sensitive information, so use with caution
config.sessionReplayConfig.screenshotMode = true
// Replays are recorded as masked screenshots, so mask anything sensitive.
// Before SDK version 4.0, also set config.sessionReplayConfig.screenshotMode = true,
// otherwise replays are recorded as wireframes and SwiftUI screens aren't recorded.

// Experimental. Only applies when \`screenshotMode\` is enabled.
// Moves screenshot rendering off the main thread, which reduces jank
// on high refresh rate (120Hz ProMotion) displays. May trigger Xcode's
// Main Thread Checker and briefly freeze the app on the first capture.
// Experimental. Moves screenshot capture to a background queue, which can
// reduce main-thread hangs and dropped frames on complex screens or high
// refresh rate (120Hz ProMotion) displays. May trigger Xcode's Main Thread
// Checker and briefly freeze the app on the first capture.
// Default is false. Requires SDK version 3.58.1 or higher.
config.sessionReplayConfig.screenshotModeBackgroundCapture = false

// Experimental. Screenshot resolution as a fraction of the screen's native
// resolution, from 0.1 to 1.0. With no value, captures one pixel per point,
// which is a third of native resolution on a 3x device. Higher values give
// sharper replays at the cost of capture time and upload size.
// Default is nil. Requires SDK version 3.93.0 or higher.
config.sessionReplayConfig.screenshotScale = nil

// Minimum time (in seconds) between snapshots. Default is 1.0s.
// Snapshots are taken when views lay out, so this caps how often one
// can be captured rather than setting a fixed frame rate.
// Lower values can make playback smoother, at the cost of more
// capture work on the device.
// Note: called \`debouncerDelay\` before version 3.21.0
config.sessionReplayConfig.throttleDelay = 1.0

// Sample rate for session recordings. A value between 0.0 and 1.0.
Expand All @@ -156,8 +152,9 @@ export const getIOSSteps = (ctx: OnboardingComponentsContext): StepDefinition[]
</Markdown>
<CalloutBox type="fyi" title="SwiftUI support">
<Markdown>
SwiftUI is only supported if the `screenshotMode` option is enabled. Custom views and
WebViews also require screenshot mode for full support.
SDK version 4.0 and later record SwiftUI, custom views and WebViews as screenshots. Earlier
Comment thread
turnipdabeets marked this conversation as resolved.
Resolved
versions only support them if the `screenshotMode` option is enabled. A `WKWebView` is
masked whole while `maskAllTextInputs` or `maskAllImages` is on, as in this snippet.
</Markdown>
</CalloutBox>
</>
Expand Down
5 changes: 1 addition & 4 deletions docs/onboarding/surveys/ios.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ function getSurveysIOSSteps(ctx: OnboardingComponentsContext): StepDefinition[]
let POSTHOG_HOST = "<ph_client_api_host>"
let config = PostHogConfig(projectToken: POSTHOG_PROJECT_TOKEN, host: POSTHOG_HOST)

// Surveys require iOS 15.0 or later
if #available(iOS 15.0, *) {
config.surveys = true
}
config.surveys = true

PostHogSDK.shared.setup(config)
`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function IOSSourceMapsInstructions(): JSX.Element {
<h3>1. Install and authenticate the PostHog CLI</h3>
<p>
The PostHog CLI handles dSYM upload for iOS apps. iOS dSYM support requires{' '}
<strong>CLI version 0.7.0 or later</strong>. Install it using one of these methods:
<strong>CLI version 0.7.7 or later</strong>. Install it using one of these methods:
</p>
<h4 className="text-sm font-semibold mt-4 mb-2">npm:</h4>
<CodeSnippet language={Language.Bash}>npm install -g @posthog/cli</CodeSnippet>
Expand Down Expand Up @@ -123,17 +123,13 @@ export function IOSSourceMapsInstructions(): JSX.Element {
Click the <strong>+</strong> button and select <strong>New Run Script Phase</strong>
</li>
<li>Make sure it's set to run last (after "Copy Bundle Resources" or similar)</li>
<li>Add the appropriate script for your package manager:</li>
<li>Add the following script:</li>
</ol>

<h4 className="text-sm font-semibold mt-4 mb-2">Swift Package Manager:</h4>
<CodeSnippet language={Language.Bash}>
{'${BUILD_DIR%/Build/*}/SourcePackages/checkouts/posthog-ios/build-tools/upload-symbols.sh'}
</CodeSnippet>

<h4 className="text-sm font-semibold mt-4 mb-2">CocoaPods:</h4>
<CodeSnippet language={Language.Bash}>{'${PODS_ROOT}/PostHog/build-tools/upload-symbols.sh'}</CodeSnippet>

<h3>4. Optional: Include source code context</h3>
<p>
By default, only debug symbols are uploaded. To include source code snippets in your stack traces (for
Expand All @@ -144,18 +140,12 @@ export function IOSSourceMapsInstructions(): JSX.Element {
<li>Set the environment variable when calling the upload script:</li>
</ol>

<h4 className="text-sm font-semibold mt-4 mb-2">Swift Package Manager:</h4>
<CodeSnippet language={Language.Bash}>
{
'POSTHOG_INCLUDE_SOURCE=1 ${BUILD_DIR%/Build/*}/SourcePackages/checkouts/posthog-ios/build-tools/upload-symbols.sh'
}
</CodeSnippet>

<h4 className="text-sm font-semibold mt-4 mb-2">CocoaPods:</h4>
<CodeSnippet language={Language.Bash}>
{'POSTHOG_INCLUDE_SOURCE=1 ${PODS_ROOT}/PostHog/build-tools/upload-symbols.sh'}
</CodeSnippet>

<p className="text-sm text-muted mt-2">
<strong>Note:</strong> Enabling this flag uploads your source code to PostHog's servers. This is
disabled by default. Only enable it if your organization's security and data-governance policies permit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export * from './elixir'
export * from './flutter'
export * from './framer'
export * from './go'
export * from './ios'
export * from './js-web'
export * from './laravel'
export * from './nodejs'
Expand Down

This file was deleted.

Loading