fix: 修复iOS抖音支付回跳注册

This commit is contained in:
Codex
2026-09-11 10:52:28 +08:00
parent 355ad119af
commit f568fa0f7a
5 changed files with 69 additions and 5 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"id": "tb-douyin-pay",
"displayName": "TB 抖音支付",
"version": "0.2.1",
"version": "0.2.2",
"description": "独立实现的抖音支付官方 SDK UTS 桥接",
"engines": { "HBuilderX": ">=4.36.0" },
"uni_modules": {
@@ -7,7 +7,13 @@ public class TbDouyinPayNative {
private static var generation = UUID()
public static func initialize(_ appId: String, _ scheme: String, _ link: String) {
DypayAPI.register(withAppID: appId, universalLink: link, callbackScheme: scheme)
if link.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
// Use the SDK's Scheme-only API instead of registering an empty
// Universal Link with the higher-priority Universal Link API.
DypayAPI.register(withAppID: appId, callbackScheme: scheme)
} else {
DypayAPI.register(withAppID: appId, universalLink: link, callbackScheme: scheme)
}
}
public static func available() -> Bool { DypayAPI.canOpenDypay() }