跳过内容

Android行为

GitHub

在Android上,插件在AccountManager下存储UUID,使用一个由插件拥有且为插件所有的认证账户。

默认账户名称使用应用程序包名作为范围。

这让UUID在应用程序私有存储被移除的通用重新安装路径中生存,包括Android Studio重新安装/重新安装周期和使用相同包名的不同调试或Play签名密钥签名的安装。

稳定范围规则

当应用程序包名在构建之间保持稳定时,使用默认范围。

const result = await PersistentUuid.getId();

当debug、staging和生产构建使用不同的包标识符但应共享一个持久的UUID时,使用自定义范围。

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

继续从Android行为

如果您正在验证Android重新安装行为,请将此页面连接到

开始

Section titled “Stable Scope Rules” Section titled “Limits” 为了 API 的使用 iOS 行为 了解 Apple 平台的差异 使用 @capgo/capacitor-persistent-uuid 查看完整的教程