哈哈6
哈哈6
  • 发布:2026-01-28 16:39
  • 更新:2026-01-28 17:05
  • 阅读:24

【报Bug】plus.runtime.argeePrivacy is not a function

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win11

HBuilderX类型: 正式

HBuilderX版本号: 4.87

手机系统: iOS

手机系统版本号: iOS 18

手机厂商: 苹果

手机机型: iphone 11

页面类型: vue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

if(permision.isIOS) {
//idfa標識
console.log('xxxxxxxxxxxxxxxxxxx')
plus.runtime.argeePrivacy();
}

操作步骤:

https://uniapp.dcloud.net.cn/tutorial/app-ios-idfa.html#privacyregistermode 按照文档配置后,在同意隐私框后执行plus.runtime.argeePrivacy

预期结果:

成功请求权限

实际结果:

报错
[Vue warn]: Error in v-on handler (Promise/async): "TypeError: plus.runtime.argeePrivacy is not a function. (In 'plus.runtime.argeePrivacy()', 'plus.runtime.argeePrivacy' is undefined)"
16:34:12.181 (found at pages/index/index.vue:1)
16:34:12.181 TypeError: plus.runtime.argeePrivacy is not a function. (In 'plus.runtime.argeePrivacy()', 'plus.runtime.argeePrivacy' is undefined)

bug描述:

https://uniapp.dcloud.net.cn/tutorial/app-ios-idfa.html#privacyregistermode 按照文档配置后,在同意隐私框后执行plus.runtime.argeePrivacy 报错, [Vue warn]: Error in v-on handler (Promise/async): "TypeError: plus.runtime.argeePrivacy is not a function. (In 'plus.runtime.argeePrivacy()', 'plus.runtime.argeePrivacy' is undefined)"
16:34:12.181 (found at pages/index/index.vue:1)
16:34:12.181 TypeError: plus.runtime.argeePrivacy is not a function. (In 'plus.runtime.argeePrivacy()', 'plus.runtime.argeePrivacy' is undefined),不配置"privacyRegisterMode": "manual",也不会默认请求权限

2026-01-28 16:39 负责人:无 分享
已邀请:
Ask小助手

Ask小助手

该问题请在专业群( uni-app 官方技术交流群 1 ) 咨询,群中有相关专业的管理员和群友。

您好,感谢反馈!

根据官方文档及知识库确认,您遇到的报错是因为 API 名称拼写错误 导致的:

  • 正确方法名plus.runtime.agreePrivacy()(注意是 agree,不是 argee)。
  • 您当前代码中写成了 plus.runtime.argeePrivacy(),因此会提示 is not a function

✅ 正确用法示例:

if (plus.os.name === 'iOS') {  
  plus.runtime.agreePrivacy(); // 正确拼写  
}

⚠️ 其他注意事项(请一并检查):

项目 要求
HBuilderX版本 ≥ 4.81
打包方式 必须使用 云端打包自定义调试基座,真机运行才生效
manifest.json配置 需添加如下配置:<br>"app-plus" > "distribute" > "ios" > "privacyRegisterMode": "manual"
调用时机 必须在用户点击“同意隐私政策”后调用,否则可能导致崩溃统计失效

? 建议操作步骤:

  1. 修正方法名为 plus.runtime.agreePrivacy()
  2. 确认 manifest.json 已配置 "privacyRegisterMode": "manual"
  3. 使用 云端打包自定义调试基座 重新运行;
  4. 如需调试是否已同意隐私政策,可使用 plus.runtime.isAgreePrivacy() 判断状态。

如仍有问题,欢迎提供打包方式(云端/自定义基座)及最小复现 demo,我们将进一步协助您排查。

内容为 AI 生成,仅供参考
哈哈6

哈哈6 (作者)

请检查文档根据文档上写的。。。plus.runtime.argeePrivacy()

  • DCloud_UNI_yuhe

    哪个文档写的 argeePrivacy ? https://www.html5plus.org/doc/zh_cn/runtime.html#plus.runtime.agreePrivacy

    2026-01-28 16:56

  • 哈哈6 (作者)

    回复 DCloud_UNI_yuhe: https://uniapp.dcloud.net.cn/tutorial/app-ios-idfa.html#privacyregistermode

    2026-01-28 17:04

  • DCloud_UNI_yuhe

    回复 哈哈6: 我改了一下问题, 你使用 agreePrivacy 试一下

    2026-01-28 17:26

哈哈6

哈哈6 (作者)

文档截图

要回复问题请先登录注册