iOS Setup
Este contenido aún no está disponible en tu idioma.
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.
1. Add the URL scheme
Section titled “1. Add the URL scheme”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>2. Forward Contentsquare deeplinks
Section titled “2. Forward Contentsquare deeplinks”Wherever your Capacitor host app handles incoming URLs, forward them to the native SDK:
AppDelegate
Section titled “AppDelegate”import ContentsquareModule
func application( _ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { Contentsquare.handle(url: url) return true}SceneDelegate
Section titled “SceneDelegate”import ContentsquareModule
func scene(_ scene: UIScene, openURLContexts urlContexts: Set<UIOpenURLContext>) { if let url = urlContexts.first?.url { Contentsquare.handle(url: url) }}SwiftUI
Section titled “SwiftUI”import ContentsquareModule
.onOpenURL { url in Contentsquare.handle(url: url)}3. Validate the installation
Section titled “3. Validate the installation”- 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.