android react-native-iap 12 请求购买

问题描述 投票:0回答:1

我将我的应用程序更新为“react-native”:“0.72.4”,并使用“react-native-iap”:“12.10.7”。但 requestPurchase 功能在 Android 中不再正常工作。

******other codes*****
const purchaseRequest = createAsyncThunk(
    "somestring/somestring",
    async ({ skuID }: { skuID : string }, { dispatch }) => {
        try {
            if (Platform.OS == "ios") {
               await requestPurchase({ sku: skuID })
            } else {
               await requestPurchase({ skus: [skuID] }) 
            }
        }
        catch (error) {
            devlog('Error occurred while making purchase',error)
        }
    }
)
******other codes*****

我阅读了文档,但除了这个答案之外我找不到任何其他内容,而且它不起作用:

requestPurchase(Platform.OS === 'ios' ? { sku } : { skus: [sku] });

我得到的错误是:

{"code": "E_SERVICE_ERROR", "debugMessage": "", "message": "Billing is unavailable. This may be a problem with your device, or the Play Store may be down.", "responseCode": 3} 
android react-native in-app-purchase react-native-iap
1个回答
0
投票

您好,您的问题解决了吗?我得到同样的错误。如果您解决了,请发布相同的解决方案。

© www.soinside.com 2019 - 2024. All rights reserved.