简体   繁体   English

如何确定用户是否取消Google Play订阅?

[英]How to determine if user cancels Google Play subscription?

About to build a subscription product into our Android app, but a little unclear on the best way to know about canceled subscriptions. 即将在我们的Android应用程序中构建订阅产品,但有一点不清楚了解取消订阅的最佳方式。 The only way we are planning on letting the user cancel is for them to go to Google Play Store and explicitly cancel, but in this case, our backend won't be notified. 我们计划让用户取消的唯一方法是让他们转到Google Play商店并明确取消,但在这种情况下,我们的后端将不会收到通知。

The Google Play Developer API docs explicitly say you must not query the API for the status of all subscriptions so how are we supposed to know which users have cancelled their subscription? Google Play Developer API文档明确表示您不能在API中查询所有订阅的状态,那么我们应该如何知道哪些用户取消了订阅?

Any help much appreciated! 任何帮助非常感谢!

According to In-App Subscription documentation there is no mechanism to detect when the user cancels the subscription. 根据In-App订阅文档,没有机制来检测用户何时取消订阅。 Since it is not canceled immediately. 因为它没有立即取消。 Instead it waits for the end of the cycle for the subscription to expire. 相反,它等待订阅的周期结束到期。

Excerpt from document ( source ) 摘自文件( 来源

When the user cancels a subscription, Google Play does not offer a refund for the current billing cycle. 当用户取消订阅时,Google Play不会为当前结算周期提供退款。 Instead, it allows the user to have access to the canceled subscription until the end of the current billing cycle, at which time it terminates the subscription. 相反,它允许用户访问已取消的订阅,直到当前结算周期结束,此时它终止订阅。 For example, if a user purchases a monthly subscription and cancels it on the 15th day of the cycle, Google Play will consider the subscription valid until the end of the 30th day (or other day, depending on the month) 例如,如果用户购买了每月订阅并在周期的第15天取消订阅,则Google Play会认为订阅有效,直到第30天结束(或其他日期,具体取决于月份)

The app won't receive any kind of notification when user cancels the subscription. 当用户取消订阅时,该应用程序将不会收到任何类型的通知。

The behavior of subscription is whenever you query the inventory in the app SKU will be returned if subscription is valid. 订阅的行为是在您查询应用程序中的库存时,如果订阅有效,则将返回SKU。 When the subscription expires the SKU won't be returned when you query the inventory. 订阅到期时,查询库存时不会返回SKU。

According to the documentation in this link 根据此链接中的文档

It is okay to run a batch query whenever subscription is nearing the end 订阅即将结束时,可以运行批量查询

Excerpt from document ( source ): 摘自文件( 来源 ):

Query for subscription status only at expiration — Once your server has retrieved the expiration date of subscription tokens, it should not query the Google Play servers for the subscription status again until the subscription is reaching or has passed the expiration date. 仅在到期时查询订阅状态 - 一旦您的服务器检索到订阅令牌的到期日期,在订阅到达或已经过期时,它不应再次向Google Play服务器查询订阅状态。 Typically, your servers would run a batch query each day to check the status of expiring subscriptions, then update the database 通常,您的服务器每天都会运行批处理查询来检查过期订阅的状态,然后更新数据库

The following server api lets you query the subscription status: 以下服务器api允许您查询订阅状态:

https://developers.google.com/android-publisher/api-ref/purchases/subscriptions#resource-representations https://developers.google.com/android-publisher/api-ref/purchases/subscriptions#resource-representations

The variables autoRenewing and cancelReason will let you know if the subscription has been canceled. 变量autoRenewingcancelReason将通知您订阅是否已被取消。

By using the above API you would be able to implement a system wherein the subscription nearing expiration can be queried for status and then determine whether they are canceled or not. 通过使用上述API,您将能够实现一个系统,其中可以查询即将到期的订阅状态,然后确定它们是否被取消。

Full details for subscription cancellation can be found at this link . 有关订阅取消的详细信息,请访问此链接

Note: 注意:
Documentation states that you should continue to provide the content as long as the user has valid subscription. 文档指出,只要用户具有有效订阅,您就应该继续提供内容。 If you are planning to deny access to the content if someone canceled the subscription will go against the Google Policy 如果您计划拒绝访问该内容,如果有人取消订阅将违反Google政策

Excerpt from document ( source ) 摘自文件( 来源

Important: In all cases, you must continue to offer the content that your subscribers have purchased through their subscriptions, as long any user is able to access it. 重要提示:在所有情况下,只要用户能够访问订阅,您就必须继续提供订阅者通过订阅购买的内容。 That is, you must not remove any 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. 也就是说,当任何用户仍然拥有有效订阅时,您不得删除任何内容,即使该订阅将在当前结算周期结束时终止。

It looks like it's now possible to receive server-side notifications about subscriptions changes (renewal, cancellation...): 看起来现在可以接收有关订阅更改的服务器端通知(续订,取消...):

The In-app Billing API provides server push notifications that give developers the capability to monitor state changes for Play-managed subscriptions. 应用内结算API提供服务器推送通知,使开发人员能够监控Play管理的订阅的状态更改。

See this page for more details: https://developer.android.com/google/play/billing/billing_subscriptions.html#realtime-notifications 有关详情,请参阅此页: https//developer.android.com/google/play/billing/billing_subscriptions.html#realtime-notifications

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

相关问题 谷歌播放订阅和移动应用免费试用自动取消/结束 - Google play subscription and free trial for mobile app automatically cancels/ends 如何确定是否已续订Google Play上的应用内订阅? - How to determine if a in-app subscription on Google Play has been renewed? 如何从客户端确定 Google Play 结算订阅是否已过期 - How determine from client side if Google Play Billing subscription is expired 如何以编程方式知道用户何时取消应用内订阅? - How to programmatically know when a user cancels an in-app subscription? 当用户取消时,Google Play 结算会做什么? - What Does Google Play Billing do when the User Cancels? 确定Google Play商店订阅何时结束 - Determine when Google Play Store subscription ends 如何区分用户是否在Google Play中订阅试用期? - How to distinguish if the user is on subscription trial period or not in google play? 我怎么知道该用户刚刚续订了 google play 订阅? - How can I know that user just renewed a google play subscription? 如何检查用户是否在 Android、Google Play 中拥有有效订阅? - How to check if the user has an active subscription in Android, Google Play? 如果用户使用一个 google play 帐户购买订阅并尝试使用另一个 google play 帐户进行升级,如何处理? - How to handle if the user purchased a subscription using one google play account and trying to upgrade with another google play account?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM