getSkuDetails()针对不同版本的Google Play返回的信息

时间:2016-02-16 22:30:35

标签: android google-play in-app-billing

Google {3}引入了Billing API v3。 API的Play Store v3.9.16方法返回有关销售的不同产品的各种信息。不幸的是,返回的信息类型似乎取决于已安装的Google Play版本。

到目前为止,我找到了3个不同版本的返回数据:

  • 在运行Google Play v4.9.13的设备(以及其他版本更新的设备)上,我获得了以下产品列表,其中包含了我希望的所有数据:

    {"title":"100 Hints (ColorTrek)","price":"$0.99","type":"inapp","description":"#0360#","price_amount_micros":990000,"price_currency_code":"USD","productId":"vdm.ct.00001"}
    {"title":"250 Hints (ColorTrek)","price":"$1.99","type":"inapp","description":"#07oK#","price_amount_micros":1990000,"price_currency_code":"USD","productId":"vdm.ct.00002"}
    {"title":"500 Hints (ColorTrek)","price":"$2.99","type":"inapp","description":"#0Fce#","price_amount_micros":2990000,"price_currency_code":"USD","productId":"vdm.ct.00003"}
    {"title":"Level Pack \"Aqua\" (50 Levels) (ColorTrek)","price":"$0.99","type":"inapp","description":"#Wn3mF00P3Cw31IAh77iR1Gy\/BAqua#","price_amount_micros":990000,"price_currency_code":"USD","productId":"vdm.ct.00004"}
    {"title":"Level Pack \"Kiwi\" (50 Levels) (ColorTrek)","price":"$0.99","type":"inapp","description":"#Wn7me00t6VQWWaBL1fSm0jzOpKiwi#","price_amount_micros":990000,"price_currency_code":"USD","productId":"vdm.ct.00005"}
    ...
    
  • 在运行Google Play v4.0.25的设备上,我只能获得:

    {"title":"100 Hints (ColorTrek)","price":"$0.99","type":"inapp","description":"#0360#","productId":"vdm.ct.00001"}
    {"title":"250 Hints (ColorTrek)","price":"$1.99","type":"inapp","description":"#07oK#","productId":"vdm.ct.00002"}
    {"title":"500 Hints (ColorTrek)","price":"$2.99","type":"inapp","description":"#0Fce#","productId":"vdm.ct.00003"}
    {"title":"Level Pack \"Aqua\" (50 Levels) (ColorTrek)","price":"$0.99","type":"inapp","description":"#Wn3mF00P3Cw31IAh77iR1Gy\/BAqua#","productId":"vdm.ct.00004"}
    {"title":"Level Pack \"Kiwi\" (50 Levels) (ColorTrek)","price":"$0.99","type":"inapp","description":"#Wn7me00t6VQWWaBL1fSm0jzOpKiwi#","productId":"vdm.ct.00005"}
    ...
    

    注意,缺少“price_amount_micros”和“price_currency_code”。

  • 在运行Google Play v3.9.16的更旧的设备上,列表如下所示:

    {"title":"100 Hints (ColorTrek)","price":"$0.99","type":"inapp","description":"","productId":"vdm.ct.00001"}
    {"title":"250 Hints (ColorTrek)","price":"$1.99","type":"inapp","description":"","productId":"vdm.ct.00002"}
    {"title":"500 Hints (ColorTrek)","price":"$2.99","type":"inapp","description":"","productId":"vdm.ct.00003"}
    {"title":"Level Pack \"Aqua\" (50 Levels) (ColorTrek)","price":"$0.99","type":"inapp","description":"","productId":"vdm.ct.00004"}
    {"title":"Level Pack \"Kiwi\" (50 Levels) (ColorTrek)","price":"$0.99","type":"inapp","description":"","productId":"vdm.ct.00005"}
    ...
    

    注意每个产品的“描述”是一个空字符串。

我找到了getSkuDetails(...),其中评论#40表示“price_amount_micros”和“price_currency_code”需要Play商店v4.3.10。

我无法找到“描述”字段的类似讨论。另外,我对这个领域存在感到有些惊讶,但是空洞......

这给我留下了以下问题:

  • v4.3.10是引入“price_amount_micros”和“price_currency_code”的实际版本吗?
  • 旧版“描述”是旧版本Play商店中的错误吗?
  • 或者我是否需要专门做一些事情来包含描述(比如选择一个区域设置)?
  • 如果没有,是否有人知道哪个版本的Play商店确实为该字段提供了正确的信息?
  • 是否有一些关于不同Play商店版本的发行说明的官方来源,讨论API行为的变化?
  • 旧Google Play商店版本的APK是否有值得信赖的来源?

0 个答案:

没有答案