XuqmGroup-RNSDK/packages/license
XuqmGroup 4e80b0bf4e fix: rn-log ErrorCapture 类型修复 + 依赖版本对齐
- ErrorCapture.ts: global → globalThis,移除 declare global 冲突
- index.ts: 移除不存在的 UpdateDownloadProgress 导出
- 各 package.json 版本号对齐

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-16 13:10:16 +08:00
..
src feat(sdk): 按跨平台规范重构所有 SDK 包接口 2026-06-15 10:57:55 +08:00
package.json fix: rn-log ErrorCapture 类型修复 + 依赖版本对齐 2026-06-16 13:10:16 +08:00
README.md docs: 添加 CLAUDE.md + 各 package README + 架构总览 + 模块待开发说明 2026-06-16 12:14:52 +08:00

@xuqm/rn-license

XuqmGroup RN SDK 证书授权模块。提供设备 License 验证能力。

安装

yarn add @xuqm/rn-license react-native-quick-crypto

Peer dependenciesreact-native >= 0.76@react-native-async-storage/async-storage >= 1.21.0react-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
}