如何恢复 iPhone 中的自动更新交易? (应用内购买)

发布于 2024-12-02 05:53:48 字数 357 浏览 1 评论 0原文

在我的申请中,更新期限是1个月。沙盒中自动更新的有效期为 5 分钟。因此交易标识符每 5 分钟就会不断变化。

最初我会购买该产品。如果成功,我将获得 SKPaymentTransaction 对象,它包含有关交易的所有详细信息,如 transactionIdentifier、transactionDate、transactionReceipt 和 transactionState。直到这我才明白。如果我调用恢复函数(ierestoreCompletedTransactions),我将获得所有已完成的交易信息。据我所知,第一个事务日志信息将是后期事务信息。

比较时,两个物体的细节是不同的。这怎么可能。我完全困惑,如何恢复此自动更新交易详细信息。任何帮助表示赞赏。

In my application, renewing period is 1 month. Validity Time for Auto-Renewables in Sandbox is 5 minutes. So transcation identifier will keep on changing after each 5 minutes.

Initially i will a buy the product. If I am successfull i will get SKPaymentTransaction object it contains all details about transcation like transactionIdentifier, transactionDate, transactionReceipt and transactionState. Till this I understood. If I call restore function, (i.e.restoreCompletedTransactions) I am getting all the completed transaction information. According to my knowledge the first transaction log information will be the late-stet transaction information.

When compare both the object's details are different. How come this is possible. I am totally confused, How to restore this Auto renewable transaction details. Any help is appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

憧憬巴黎街头的黎明 2024-12-09 05:53:49

要确认用户的订阅是否已续订,请恢复已完成的交易并将第一笔交易的收据发送给苹果。作为回应,苹果将向您发送交易的当前状态。

有关详细参考,请阅读以下链接
<一href="http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/RenewableSubscriptions/RenewableSubscriptions.html#//apple_ref/doc/uid/TP40008267-CH4-SW2 ">http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/RenewableSubscriptions/RenewableSubscriptions.html#//apple_ref/doc/uid/TP40008267-CH4-SW2

特别是表 7-2 自动更新订阅信息密钥

之后,将您的数据以 Json 格式发送给苹果(请注意,收据部分必须采用 Base 64 编码。)并仔细阅读响应。作为回应,您将根据具体情况找到上表中给出的代码。

请注意,在真实环境中,收据验证应该来自另一台服务器,而不是来自 iPhone 或 iPad 本身。

如果您还有任何疑问,请在此发帖。

To confirm that user's subscription was renewed or not, restore completed transaction and send first transaction's receipt to apple. In response apple will send you current status of the transaction.

For detailed reference read following link
http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/StoreKitGuide/RenewableSubscriptions/RenewableSubscriptions.html#//apple_ref/doc/uid/TP40008267-CH4-SW2

Specially Table 7-2 Auto-renewable subscription info keys

After that send your data to apple in Json format (Note that receipt part has to base 64 encoded.) and read the response carefully. In response you will find codes given in above table depending upon situation.

Please note that in real environment receipt verification should be dome from another server not from iPhone or iPad itself.

Post here if you have any further doubts.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文