sumsub-integrate-msdk
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSumsub — Mobile SDK integration (iOS)
Sumsub — Mobile SDK 集成(iOS)
Embed Sumsub KYC into an existing iOS app via the framework
(main class ), from dependency install to presenting the
verification flow.
IdensicMobileSDKSNSMobileSDKiOS only. This skill targets the iOS Mobile SDK. Android is not covered yet.
This is the trunk: read the always-on sections below (intake, asking-vs-doing),
then use the decision table to open only the branch
files that match the project and the user's answers.
通过**框架(主类为**)将Sumsub KYC嵌入现有iOS应用,内容涵盖从依赖安装到验证流程展示的全步骤。
IdensicMobileSDKSNSMobileSDK仅适用于iOS。本技能针对iOS Mobile SDK,暂不覆盖Android平台。
这是主干内容:请先阅读下方固定章节(需求收集、询问与执行规则),再通过决策表打开仅匹配项目和用户回答的分支文件。
Intake — ask these three questions first, in one message
需求收集 — 先一次性询问以下三个问题
Before touching any project file, ask all three together:
-
Launch point. "From which screen / ViewController (or SwiftUI view) should the Sumsub flow open? Please share the class name or describe the screen."
-
Access token source. "Does your app already have a way to fetch a Sumsub access token from your backend? (If yes, share the function name, endpoint URL, or service class. If not, I'll add a placeholder you can fill in when your backend is ready.)"
-
Optional modules. "The base SDK covers standard verification flows and is always installed. On top of it, do you need any of these add-ons?
- MRTDReader — read the chip on biometric passports
- VideoIdent — live video call with a moderator
- EID — German eID card reading
- Fisherman — device intelligence / fraud signals Skip them if you're not sure — they can be added later."
Modules are purely additive. In a multi-select, list only the four modules — an empty selection already means "base only"; don't add "base only" as a co-selectable peer.
Do not ask about: the App Token or the secret key — those are server concerns
that never touch the app.
在修改任何项目文件前,请一次性询问所有三个问题:
-
启动入口:“Sumsub流程应从哪个屏幕/ViewController(或SwiftUI视图)打开?请提供类名或描述该屏幕。”
-
访问令牌来源:“您的应用是否已有从后端获取Sumsub访问令牌的方式?(如果有,请提供函数名、端点URL或服务类;如果没有,我将添加一个占位符,您可在后端就绪后补充实现。)”
-
可选模块:“基础SDK已覆盖标准验证流程,且必须安装。除此之外,您是否需要以下任一附加模块?
- MRTDReader — 读取生物特征护照芯片
- VideoIdent — 与审核员进行实时视频通话
- EID — 读取德国电子身份证
- Fisherman — 设备智能/欺诈信号检测 若不确定可暂不选择——这些模块可后续添加。”
模块为纯增量添加。多选时仅列出上述四个模块即可——未选择任何模块即表示“仅使用基础版”;请勿将“仅基础版”作为可选选项。
请勿询问:App Token或密钥——这些属于服务器端事项,绝不会涉及应用端。
Asking vs doing — keep approvals meaningful
询问与执行规则 — 确保审批有意义
- Read-only is free — scan / grep / read & build settings without asking.
Info.plist - Batch mutations into one approval, not one per line ("I'll add these 3 Info.plist keys [list] + this call site [diff] — apply?").
- Ask explicitly only for: editing existing app code, project-mutating commands
(), anything irreversible, and decisions you couldn't settle in intake.
pod install
- 只读操作无需审批 — 可直接扫描/搜索/读取和构建设置,无需询问。
Info.plist - 批量变更合并为一次审批,而非逐行申请(例如:“我将添加这3个Info.plist键[列出] + 这个调用点[差异内容]——是否执行?”)。
- 仅需明确询问的操作:修改现有应用代码、会变更项目的命令(如)、不可逆操作,以及需求收集阶段未明确的决策。
pod install
How to navigate this skill
如何使用本技能
After intake, open ONLY the rows that match the project (from Step 1) and the user's
intake answers. Each branch file is self-contained and ends with a Next pointer.
A letter (2A/2B, 6A/6B) marks a branch — pick one; plain numbers run in sequence.
| Step | Condition | Read |
|---|---|---|
| 1. Scan | always (first, after intake) | |
| 2A. Install — CocoaPods | CocoaPods chosen (per Step 1) | |
| 2B. Install — SPM | SPM chosen (per Step 1; the default) | |
| 3. Permissions & capabilities | always | |
| 4. Integration file | always | |
| 5. Wire into target | always (right after creating the file) | |
| 6A. Launch — UIKit | host is a UIKit ViewController | |
| 6B. Launch — SwiftUI | host is a SwiftUI view | |
Fallback (last resort only). This skill and its branch files are the primary source — don't reach for external docs by default. Only if you hit a genuine blocker they don't resolve, consult the Sumsub iOS docs.
When the tree is walked, return here for Guardrails and Handoff.
完成需求收集后,仅打开匹配项目(步骤1结果)和用户回答的分支文件。每个分支文件都是独立的,结尾带有下一步指引。字母标记(2A/2B、6A/6B)表示分支选项——选择其一;纯数字表示按顺序执行。
| 步骤 | 条件 | 阅读文件 |
|---|---|---|
| 1. 扫描 | 始终执行(需求收集后第一步) | |
| 2A. 安装 — CocoaPods | 选择CocoaPods(根据步骤1结果) | |
| 2B. 安装 — SPM | 选择SPM(根据步骤1结果;默认选项) | |
| 3. 权限与功能配置 | 始终执行 | |
| 4. 集成文件 | 始终执行 | |
| 5. 关联到目标页面 | 始终执行(创建文件后立即操作) | |
| 6A. 启动 — UIKit | 宿主为UIKit ViewController | |
| 6B. 启动 — SwiftUI | 宿主为SwiftUI视图 | |
备用方案(仅万不得已时使用)。本技能及其分支文件为主要参考来源——默认请勿查阅外部文档。仅当遇到本技能无法解决的真正障碍时,才参考Sumsub iOS文档。
完成所有分支步骤后,请回到此处查看防护规则和交付总结。
Guardrails — what this skill must never do
防护规则 — 本技能绝对禁止的操作
- Never edit existing app code beyond the single targeted call site the user approved in intake.
- Let the SDK present itself — in SwiftUI too. Always launch via (
SumsubVerification.start()/sdk.present()). Never strong-hold the SDK or itssdk.present(from:)across the flow, and never bridgemainVCinto a SwiftUIsdk.mainVC/.fullScreenCover..sheetstrong-retains the SDK and the SDK firesmainVCfrom that controller'sonDidDismiss; holding it yourself delays teardown and causes "opens every other time" + a crash on re-open. The SDK owns presentation and dismissal — one owner, clean re-open.dealloc - Never run (or any other shell command that modifies the project) without explicit user permission in the current message.
pod install - Never ask for or reference the App Token or secret key — tokens are minted server-side.
- Never store or reference the App Token or secret key in any app file.
- Never silently overwrite an existing Info.plist key — always show the current value and ask first.
- Never apply theme changes in this skill — styling belongs in .
sumsub-theme-msdk - Never gate access on in-app callbacks — the authoritative verdict comes from the backend (webhook + applicant GET), not the SDK callbacks.
- 绝不能修改现有应用代码超出需求收集阶段用户批准的单个目标调用点。
- 让SDK自行处理展示——SwiftUI中也应如此。始终通过(
SumsubVerification.start()/sdk.present())启动。绝不能在整个流程中强引用SDK或其sdk.present(from:),也绝不能将mainVC桥接到SwiftUI的sdk.mainVC/.fullScreenCover中。.sheet会强引用SDK,且SDK会从该控制器的mainVC方法触发dealloc;自行持有onDidDismiss会延迟销毁,导致“每隔一次才能打开”以及重新打开时崩溃。SDK应全权负责展示和关闭——单一所有者,确保重新打开时无问题。mainVC - 绝不能运行(或任何其他会修改项目的shell命令),除非在当前消息中获得用户明确批准。
pod install - 绝不能询问或引用App Token或密钥——令牌由服务器端生成。
- 绝不能在任何应用文件中存储或引用App Token或密钥。
- 绝不能静默覆盖现有Info.plist键——始终先显示当前值并询问用户。
- 绝不能在本技能中进行主题变更——样式定制属于的范畴。
sumsub-theme-msdk - 绝不能依赖应用内回调判断结果——最终验证结果来自后端(Webhook + 申请人信息查询),而非SDK回调。
Handoff
交付总结
After all changes are complete, summarise clearly:
- Files created / modified — list each with a one-line description.
- Stub that needs filling in — if is a placeholder, say so explicitly and describe what the user must implement.
fetchAccessToken - Build step — e.g. "Run , then open the
pod installand build" or "Build and run — SPM packages will resolve automatically.".xcworkspace - How to test — explain: get a sandbox access token from your backend (or temporarily hardcode one), trigger the integration object's from the launch point, and verify the Sumsub flow appears. (NFC modules need a physical device — not the simulator.)
start(…) - Source of truth — remind the user: the final verification result comes from the backend webhook + applicant read, not from the SDK callbacks.
- Next steps — point to for styling.
sumsub-theme-msdk
完成所有变更后,请清晰总结以下内容:
- 创建/修改的文件——列出每个文件并附上一行描述。
- 需补充的占位符——如果是占位符,请明确说明,并描述用户需要实现的内容。
fetchAccessToken - 构建步骤——例如:“运行,然后打开
pod install并构建”或“直接构建运行——SPM包会自动解析”。.xcworkspace - 测试方法——说明:从后端获取沙箱访问令牌(或临时硬编码一个),从启动入口触发集成对象的方法,验证Sumsub流程是否正常显示。(NFC模块需要物理设备——模拟器无法测试。)
start(…) - 结果来源——提醒用户:最终验证结果来自后端Webhook + 申请人信息查询,而非SDK回调。
- 下一步建议——指向进行样式定制。
sumsub-theme-msdk