gpt4 book ai didi

Android:应用内计费 - 取消订阅

转载 作者:太空狗 更新时间:2023-10-29 16:05:49 25 4
gpt4 key购买 nike

根据文档“当用户在有效的结算周期取消订阅时,Google Play 不会立即将购买状态的变化通知您的应用”。也就是说,订阅在 Activity 计费周期结束之前是“有效的”。 (在此之前,不能进行新的订阅)。但是,如果您取消订阅并卸载您的应用(并重新安装),是否会触发购买状态更改 (onPurchaseStateChange)(因为在这种情况下可以进行新的购买/订阅)或者它是如何工作的?

我也许可以在我的应用中使用基于 HTTP 的 API 来请求购买状态(?),但它会在有效的计费周期内返回 CANCELED 吗?

也链接到 this问题。

最佳答案

But if you cancel the subscription and uninstall your app (and reinstalling it again), would that trigger a purchase state change (onPurchaseStateChange) (Since a new purchase/subscription can be made in this case) or how does it work?

即使卸载/重新安装后,订阅仍将显示为 Activity 状态。因为确实,它是活跃的。在这种情况下取​​消意味着在当前周期结束后不会自动向用户收费。

I could maybe use HTTP-based API in my app to request the purchase state(?), but does it return CANCELED during an active billing cycle?

是的,您可以使用 Google Play Android Developer API .请记住,此 API 需要身份验证 token ;并且您必须使用用于发布应用程序的同一 Google 帐户。因此,出于安全原因,这必须在您自己的服务器上完成。

但有趣的是:即使您使用 API 并检查最近取消的订阅,它也会显示为有效。

这方面的一个例子可能是调用 API 来检查已取消的订阅:

https://www.googleapis.com/androidpublisher/v1.1/applications/YOUR-PACKAGE-NAME/
subscriptions/THE-SUBSCRIPTION-SKU/
purchases/PURCHASE-TOKEN-GOES-HERE?access_token=AUTH-TOKEN-GOES-HERE

结果如下:

{
"kind": "androidpublisher#subscriptionPurchase",
"initiationTimestampMsec": "1379986154994",
"validUntilTimestampMsec": "1382621354994",
"autoRenewing": false
}

因此,如果订阅被取消,您必须知道的唯一提示是 autoRenewing,它被设置为 false。这并不意味着您必须停止提供订阅内容。正如文档所表达的那样:

Important: In all cases, you must continue to offer the content that your subscribers have purchased through their subscriptions, for as long any users are able to access it. That is, you must not remove any subscriber’s content while any user still has an active subscription to it, even if that subscription will terminate at the end of the current billing cycle. Removing content that a subscriber is entitled to access will result in penalties. Please see the policies document for more information.

关于Android:应用内计费 - 取消订阅,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15560259/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com