uni.getProvider({
service: 'payment',
success: (res) => {
const iapChannel = res.providers.find((channel) => {
return (channel.id === 'appleiap')
})
}
});

- 发布:2022-08-04 10:52
- 更新:2022-08-04 17:35
- 阅读:909
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 3.5.3
手机系统: iOS
手机系统版本号: iOS 15
手机厂商: 苹果
手机机型: iphone6s
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
操作步骤:
预期结果:
期望iapChannel是带有支付相关方法的一个对象
期望iapChannel是带有支付相关方法的一个对象
实际结果:
TypeError: undefined is not a function (near '...iapChannel.requestProduct...') __ERROR
TypeError: undefined is not a function (near '...iapChannel.requestProduct...') __ERROR
bug描述:
苹果应用内支付,uni.getProvider方法获取IAP支付通道,按API文档的示例代码会报错:TypeError: undefined is not a function (near '...iapChannel.requestProduct...') __ERROR ,而且res.providers返回的只是个字符串数组
1 个回复
天生DR - 天生我材必有用
确认你的mainfest.json 里 是否勾选了 pay 苹果支付