如何将用户与涉及Apple状态通知的自动续订订阅相关联? [英] How do I associate a user with an auto-renewable subscription involving Apple's status notifications?
问题描述
如何以可让我知道MY数据库中哪些用户的通知的方式关联自动续订订阅?我可以将原始收据中的某种ID存储为用户的字段吗?
How do I associate an auto-renewable subscription in a way that lets me know which notifications are for which users in MY database? Is there some sort of id from the original receipt that I can store as a field for a User?
很高兴我知道用户何时取消或续订等等但是我无法确定发生了哪个用户也无济于事。
It is great that I know when a user cancels or renews, etc but it doesn't help that I am not sure which user this is happening for.
当你访问文档并向下滚动到状态更新通知,您会注意到状态通知确实有 original_transaction_id
字段,这是否会持续存在并且可以依赖?
When you visit the docs and scroll down to Status Update Notifications, you'll notice that status notifications do have an original_transaction_id
field, is this something that persists and can be relied on?
推荐答案
是的,您可以使用 original_transaction_id
。它的属性为所有续订保存。
Yes, you can use original_transaction_id
. It's property saved for all renews.
如果用户取消订阅并购买新订阅,那么 original_transaction_id
将更改。
If the user cancels their subscription and buys a new subscription, then original_transaction_id
will change.
但是,如果用户升级或降级其订阅, original_transaction_id
将不更改。
However, if the user upgrades or downgrades their subscription, original_transaction_id
will not change.
现代版iOS支持iOS 10。
This is supported on modern versions of iOS, including iOS 10.
另一种方法它是保存一个 transaction_id
值的数组,并将它们与用户帐户相关联。根据您的需要,这可能对您更有效。
Another way to do it is to save an array of transaction_id
values and associate these with user accounts. Depending on your needs, this might work better for you.
UPD by Stafox :时间 original_transaction_id
可能会在续订后发生变化,取消和重新订阅后可能仍然相同。
UPD by Stafox: time-to-time original_transaction_id
may changes after renew and may still the same after cancel and resubscribe.
这篇关于如何将用户与涉及Apple状态通知的自动续订订阅相关联?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!