- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在我们的后端服务器中,当用户
我们必须知道,旧购买 token 和新购买 token 都指的是同一个用户。
原因是,之前,用户已经使用旧的已取消订阅购买 token 在服务器中创建了一些数据。
当用户取消订阅并再次重新订阅时,我们希望确保用户仍然有权使用新的购买 token 访问旧数据。
我们希望我们可以从 linkedPurchaseToken
获取信息,其中新的购买 token 将指向旧的购买 token 。
然而,根据我们的测试结果,情况并非如此。
credentials = service_account.Credentials.from_service_account_file(
constant.PATH_TO_SERVICE_ACCOUNT_JSON,
scopes = constant.SCOPES
)
androidpublisher = googleapiclient.discovery.build(
'androidpublisher',
'v3',
credentials = credentials
)
product = androidpublisher.purchases().subscriptions().get(
packageName = "com.xxx.yyy",
subscriptionId = product_id,
token = token
).execute()
return product
{
'startTimeMillis':'1619245597271',
'expiryTimeMillis':'1619246015249',
'autoRenewing':True,
'priceCurrencyCode':'SGD',
'priceAmountMicros':'6980000',
'countryCode':'SG',
'developerPayload':'',
'paymentState':1,
'orderId':'GPA.3314-4833-2752-47988',
'purchaseType':0,
'acknowledgementState':1,
'kind':'androidpublisher#subscriptionPurchase'
}
{
'startTimeMillis':'1619244776697',
'expiryTimeMillis':'1619245074590',
'autoRenewing':False,
'priceCurrencyCode':'SGD',
'priceAmountMicros':'6980000',
'countryCode':'SG',
'developerPayload':'',
'cancelReason':3,
'orderId':'GPA.3358-9904-1003-13416',
'purchaseType':0,
'acknowledgementState':1,
'kind':'androidpublisher#subscriptionPurchase'
}
我们没有linkedPurchaseToken
信息。因此,我们无法知道这两个订阅指的是同一个用户。
在 Google Play Console 中,即使订单 ID 不同,也能分辨出订阅来自同一用户。 但是,无法通过 Google Play Developer API 响应知道这一点。
我们的初步猜测是,这可能是因为我们的 Google Play 管理中心未启用重新订阅功能。
但是,目前,我们所有的生产/测试版/测试版 APK 早已升级到 3.0.1。因此,我们不确定是否存在这样的消息:“Resubscribe is not currently available for your users because your app does not use Billing Library 2.0 in all active APKs.”消息。
知道吗,我们如何才能知道最新的活跃订阅和取消的非活跃订阅是否实际上指的是同一个用户?
最佳答案
在原始取消订阅到期之前重新订阅将重新使用相同的购买 token 。原订阅过期后重新订阅视为新购买,因此您将获得全新的购买 token ,并且不会设置 linkedPurchaseToken 字段。链接的购买 token 字段实际上仅为升级和降级流程设置。参见 Purchase Tokens and Order IDs docs .
过去,linkedPurchaseToken 是为重新订阅流程设置的,如果您在原始订阅到期之前取消并重新订阅,就会发生这种情况。用Resubscribe这已不再是这种情况。 (请注意,Medium 文章有 an updated note 和此信息 - 免责声明我是该文章的作者)。具体来自重新订阅文档:
A restored subscription uses the same the purchaseToken from when the subscription was cancelled. All cancellation fields are cleared from the resource.
因此不会设置 linkedPurchaseToken。注意:只有当重新订阅发生在原始订阅到期之前时,才会发生这种情况。
在您上面提供的购买示例中,在我看来,第二次购买似乎是在原始的第一次订阅到期后发生的。 (新订阅的 'startTimeMillis':'1619245597271'
大于旧订阅的 'expiryTimeMillis':'1619245074590'
,因此旧订阅已经过期。在这种情况下,新订阅被视为具有全新购买 token 的全新订阅。
在回答您关于如何将两次购买联系在一起的问题时,答案是您不能按照设计只使用 Google Play 提供的信息。每个购买 token 及其相关信息均不包含用户身份信息。
但是,当您说“[服务器] 中的数据”是从第一次购买时保存下来的,这让我认为您拥有一个带有某种用户帐户的后端服务器。在这种情况下,您应该在您的后端服务器上和您自己的代码中将两次购买与特定用户相关联。这是执行此操作的正确方法(请参阅 Classy Taxi sample)。
注意:我注意到 upgrade/downgrade docs仍然提到过时的重新注册。
关于android - Google Play Developer API - 为什么在用户执行重新订阅时找不到 linkedPurchaseToken?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67240094/
我在 A 和 B 两个团队工作。因此我需要创建和安装两个开发证书。当我在 Xcode 的“build设置”中将“代码签名身份”设置为一般值“iOS Developer”时,我两个团队的应用程序正在构建
我刚刚将 XCode 升级到 4.3.1。我正在使用脚本来构建(然后通过 Testflight 部署)我的应用程序。但我现在收到此错误: Error: No developer directory f
我找不到在 Firefox Developer Edition 56.0b4 上的所有 .js 和 .css 文件中搜索字符串的方法。 我找到了办法,但那是在52版本之前。我想知道为什么他们删除了这个
我制作了一个 Gatsby starter,两个不同的人向我报告说他们无法运行它,因为它在构建“开发包”时卡住了。开发和生产构建都不起作用。我无法在我自己的机器上重现这个问题,但我想为想要使用我的 s
我正在尝试创建一个过去 3 周的苹果开发者帐户。选择后 “选择您的实体类型 = 个人”和“条款和条件 = 同意” 出现错误提示“您的注册无法完成”。我给支持打了几次电话,发了几次邮件,他们都只是简单地
我会使用robovm填写我正在使用Android libgdx进行研究的应用程序,但我无法识别证书。 xcode首选项中的证书已正确下载,然后通常可以正常使用....我做了什么,因为它已过期,然后我使
如何禁用 同源政策在 Firefox 开发者版中。出于某种原因,我认为在 Developer Edition 中执行此操作应该很容易,但我找不到设置。 最佳答案 老实说,您不应该在任何浏览器中执行此操
我有一个提交列表(最新的在前): abcd4 message abcd3 wrong commit message2 abcd2 wrong commit message1 abcd1 message
假设当前分支是 MyFeatureX。并且本地 develop 分支是最新的。下面的两个陈述是等价的吗?推荐的语法是什么? git rebase origin/develop git rebase d
我刚刚 merge 了我的整个 develop history历史进入我的主分支。正如我所见,应该连接 network graph 中的两个分支,它没有。另外,我的主分支显示:This branch
嗨,我有一个基于主分支的开发分支。 我在开发分支中进行了更改。 现在,我的问题是如果要更新 master 分支,如何在不丢失我在 develop 分支中的更改的情况下升级基于 master 分支的 d
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
与 firebug 相比,我更喜欢 firefox 开发人员检查器。 但是可以在原生 JS 控制台中显示 PHP 日志吗? 谢谢 :) 最佳答案 我刚刚安装了 Chrome Logger ( gith
今天我注意到我的 Mac 上有最新版本的 Xcode,一个在/Developer/Applications 中,另一个在/Applications 中。 /Applications 中的那个是 App
这很奇怪。显然,针对我的本地 develop 分支和远程 develop 分支进行 rebase 之间存在一些差异。以下是一些详细信息: 假设我有一个特性分支,feat,我不时对其进行 rebase:
这个问题在这里已经有了答案: difference between origin/branch_name and branch_name? (4 个答案) 关闭 5 年前。 我是新手,开始在项目中使
已经有很多关于此的问题回答了我的一些问题。我正在寻找在设置和管理这两个帐户方面有直接经验的人。 我有一种情况需要向超过 100 人发送私有(private) Beta 测试(iOS 的临时设备限制),
我想了解如何获取开发人员ID应用程序或开发人员ID安装程序证书的私钥? 开发人员ID证书只能由帐户持有者 https://developer.apple.com/support/roles/创建-完成
Mac Developer中的3rd Party Mac Developer Application和Code Signing Identity配置文件有什么区别?哪个是Mac App Store发行
我正在尝试使用 OminChannel 方法将 Google Pay 集成到我的网站中。官方文档提到 要打开 Google API 库,请从导航菜单中选择 API 和服务 > 库。搜索“NBU 付款
我是一名优秀的程序员,十分优秀!