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。
我无法找到“描述”字段的类似讨论。另外,我对这个领域存在感到有些惊讶,但是空洞......
这给我留下了以下问题: