跳过内容

iOS 行为

GitHub

存储模型

存储模型

在 iOS 上,插件将 UUID 存储在 Keychain 中作为一个通用密码项。该项仅在设备上使用,并使用包标识符作为默认范围。

此项在应用程序更新和 iOS 更新后仍然有效。它也在重新安装流程中有效,前提是 iOS 保留 Keychain 项,并且应用程序保留通过相同的包和 Apple 团队规则保持兼容的 Keychain 访问。

使用自定义范围时复制到剪贴板

const result = await PersistentUuid.getId();

Use a custom scope when multiple build variants should resolve to one app identifier.

const result = await PersistentUuid.getId({ scope: 'com.example.app' });

如果用户清除设备、Keychain数据被清除、Keychain访问权限改变、bundle/团队访问权限改变或应用程序调用resetId,则UUID可能会丢失。

继续从iOS行为

标题:继续从iOS行为

如果您正在验证iOS持久性,请将此页面连接到 开始使用 为API使用 Android行为 为Android重新安装行为 使用@capgo/capacitor-persistent-uuid 了解完整的教程。