问题描述
Google将于2020年11月1日更改其政策:需要启用订阅“保留” https://android-developers.googleblog.com/2020/06/new-features-to-acquire-and-retain-subscribers.html
目前,这是我如何查询用户是否购买了我的订阅(我的应用中只有1个订阅)并相应地授予他特权:
private void queryPurchase() {
Purchase.PurchasesResult purchasesResult = mBillingClient.queryPurchases(BillingClient.SkuType.SUBS);
if (purchasesResult != null) {
if (purchasesResult.getPurchasesList() != null) {
if (purchasesResult.getPurchasesList().size() > 0) {
String purchasetoken = purchasesResult.getPurchasesList().get(0).getPurchasetoken();
if (purchasesResult.getPurchasesList().get(0).toString().contains("productId\":\"" + "myID")) {
//grant user subscription's privileges
}
}
else {
//do not grant user subscription's privilege
}
}
}
}
我的问题是:
解决方法
自11月1日以来,我的一些应用程序仅在服务器端进行了更改,因此与用户界面/消息无关。而且由于我没有收到任何拒绝或警告,所以可以得出结论,不需要进行UI /消息传递更改。 如果Google的要求更加明确,避免浪费时间,那就太好了!