简体   繁体   English

使用多种 applicationId 风格测试 Android 应用内购买?

[英]Test Android in-app purchases with multiple applicationId flavors?

The app I'm working on needs to have 3 variants (dev, QA, live) each with different application IDs, so testers can have multiple variants simultaneously installed.我正在开发的应用程序需要有 3 个变体(开发、QA、实时),每个变体具有不同的应用程序 ID,因此测试人员可以同时安装多个变体。 I implemented the above using flavors, but now the dev and QA builds no longer receive the app's subscriptions skuDetails when calling querySkuDetailsAsync() , only the live flavor works.我使用风味实现了上述功能,但现在开发和 QA 构建在调用querySkuDetailsAsync()时不再接收应用程序的订阅 skuDetails,只有实时风味有效。 Is there any way I can make in-app purchases work for all 3 flavors, while still being able to install multiple flavors simultaneously in the same device?有什么方法可以让应用内购买适用于所有 3 种风格,同时仍然能够在同一设备上同时安装多种风格?

build.gradle flavor config: build.gradle 风味配置:

flavorDimensions  "client", "server"
productFlavors {
    dev {
        dimension "client"
        versionNameSuffix "-dev"
        applicationIdSuffix ".dev"
    }
    qa {
        dimension "client"
        versionNameSuffix "-qa"
        applicationIdSuffix ".qa"
    }
    live {
        dimension "client"
    }
    prod {
        dimension "server"
    }
    mock {
        dimension "server"
    }
}

This is not possible as applicationIdSuffix , makes the packageName different to what the IAP's signature is looking for ie.这是不可能的,因为applicationIdSuffix使packageName与 IAP 签名正在寻找的不同,即。 prod signed variant, so even if you prod sign any other variant, you will get an empty list of SKUs prod 签名变体,因此即使您对任何其他变体进行签名,您也会得到一个空的SKUs列表

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM