- ErrorCapture.ts: global → globalThis,移除 declare global 冲突 - index.ts: 移除不存在的 UpdateDownloadProgress 导出 - 各 package.json 版本号对齐 Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| package.json | ||
| README.md | ||
@xuqm/rn-license
XuqmGroup RN SDK 证书授权模块。提供设备 License 验证能力。
安装
yarn add @xuqm/rn-license react-native-quick-crypto
Peer dependencies:react-native >= 0.76,@react-native-async-storage/async-storage >= 1.21.0,react-native-quick-crypto >= 0.7.0
使用
无需独立初始化。 内部自动调用 awaitInitialization() 等待 XuqmSDK 就绪。
import { checkLicense, getStatus, clear } from '@xuqm/rn-license'
// 验证 License
const result = await checkLicense()
if (result.type === 'success') {
console.log('License 通过:', result.reason)
} else {
console.error('License 失败:', result.message)
}
// 获取状态
const status = await getStatus() // 'ok' | 'denied' | 'unknown'
// 清除本地缓存(调试用)
await clear()
API
| API | 说明 |
|---|---|
checkLicense(userInfo?) |
验证设备 License |
getStatus() |
获取当前 License 状态 |
getDeviceId() |
获取设备 ID |
clear() |
清除本地 License 缓存 |
类型
interface LicenseUserInfo {
userId?: string
userSig?: string
}
type LicenseStatus = 'ok' | 'denied' | 'unknown'
interface LicenseResult {
type: 'success' | 'denied' | 'error'
reason?: string
message?: string
}