尚未收集儲存庫資訊。
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
Verify with Tiswa for iOS apps (Swift Package Manager)
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗Verify with Tiswa from an iPhone app. The package starts the check with PKCE and opens the Tiswa app, or the web sheet in ASWebAuthenticationSession when Tiswa isn't installed. The shopper comes back to your app with a one-time code.
Docs: https://developers.tiswa.app/developers/mobile
Swift Package Manager: https://github.com/samifathi26/tiswa-verify-swift, from 0.1.0. iOS 15 or later.
import TiswaVerify
let tiswa = TiswaVerify(configuration: .init(
publishableKey: "tsw_pk_live_…",
program: "prg_…",
redirectURI: URL(string: "https://shop.example.sa/tiswa/app-callback")!))
let result = try await tiswa.verify(nonce: cart.id)
// Send result.code, result.codeVerifier and result.redirectURI to your backend,
// which calls POST /v1/oauth/token with the secret key.
Pass every URL your app opens to TiswaVerify.handle(_:) (onOpenURL, scene(_:openURLContexts:), and scene(_:continue:) for universal links).
Register the redirect for an iOS client in the Tiswa console. If verify throws, carry on at full price.
swift test
MIT. See LICENSE.