跳过内容

iOS 设置

GitHub

内容广场跟踪会自动启动一旦插件安装完成,但iOS内应用功能,如SDK日志、截屏捕获和回放配置仍需要上游URL处理设置。

1. 添加URL方案

标题:1. 添加URL方案

添加 cs-$(PRODUCT_BUNDLE_IDENTIFIER) 到您的应用程序URL方案中(Xcode或主机应用程序) Info.plist.

<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>cs-$(PRODUCT_BUNDLE_IDENTIFIER)</string>
</array>
</dict>
</array>
标题:2. 将Contentsquare deeplinks转发

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

将它们转发到本机__CAPGO_KEEP_1__:

AppDelegate
import ContentsquareModule
func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey : Any] = [:]
) -> Bool {
Contentsquare.handle(url: url)
return true
}

复制到剪贴板

SceneDelegate
import ContentsquareModule
func scene(_ scene: UIScene, openURLContexts urlContexts: Set<UIOpenURLContext>) {
if let url = urlContexts.first?.url {
Contentsquare.handle(url: url)
}
}

SwiftUI

SwiftUI
import ContentsquareModule
.onOpenURL { url in
Contentsquare.handle(url: url)
}
  • 在设备或模拟器上启动应用。
  • 使用 Xcode 或 Console 过滤日志。 CSLIB.
  • 打开 Contentsquare 移动工具并触发内应用功能以确认 deeplink 被处理。

如果您正在使用 iOS 设置 为了计划原生插件工作,连接它与 使用 @capgo/capacitor-contentsquare 对于原生功能在使用 @capgo/capacitor-contentsquare 中 Capgo 原生插件目录 对于产品工作流程在 Capgo 原生插件目录中 Capacitor 由 Capgo 提供的插件 对于实现细节在 Capacitor 由 Capgo 提供的插件中 添加或更新插件 对于实现细节在添加或更新插件中, Ionic 企业插件替代方案 对于产品工作流程在 Ionic 企业插件替代方案中