Langsung ke konten

iOS Setup

Konten ini belum tersedia dalam bahasa Anda.

Contentsquare tracking starts automatically once the plugin is installed, but iOS in-app features such as SDK logs, screenshot capture, and replay configuration still need the upstream URL handling setup.

Add cs-$(PRODUCT_BUNDLE_IDENTIFIER) to your app URL schemes in Xcode or your host app’s Info.plist.

<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>cs-$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</array>
</dict>
</array>

Wherever your Capacitor host app handles incoming URLs, forward them to the native SDK:

import ContentsquareModule
func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
Contentsquare.handle(url: url)
return true
}
import ContentsquareModule
func scene(_ scene: UIScene, openURLContexts urlContexts: Set<UIOpenURLContext>) {
if let url = urlContexts.first?.url {
Contentsquare.handle(url: url)
}
}
import ContentsquareModule
.onOpenURL { url in
Contentsquare.handle(url: url)
}
  • Launch the app on a device or simulator.
  • Filter Xcode or Console logs with CSLIB.
  • Open the Contentsquare mobile tooling and trigger in-app features to confirm the deeplink is handled.