在应用内购买:“恢复”已购买但尚未完成的交易 [英] In app Purchase: "Restore" a transaction that has been purchased but not completed

查看:240
本文介绍了在应用内购买:“恢复”已购买但尚未完成的交易的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果他/她注册了可自动续订的订阅,我有一个为用户注册数据库的应用。

I've got an app that register a database for the user if he/she signs up for a auto-renewable subscription.

如果用户已完成购买并且应用程序崩溃或服务器处于脱机状态,因此用户无法注册数据库。用户需要以后能够注册数据库。

If user have made the purchase and the app crash or server is offline so user is not able to register the database. User need to be able to register the database later.

所以问题是如何恢复未调用此事务的交易

So question is how do i "restore" a transaction that haven't called this

[[SKPaymentQueue defaultQueue] finishTransaction: transaction]; 

如果我重新启动应用程序并打印出来,我将获得一个空数组。

If i restart the app and prints this i will get an empty array.

[[SKPaymentQueue defaultQueue] transactions];


推荐答案

您无需做任何事情。如果您在应用程序关闭之前没有机会调用 -finishTransaction:,那么下次您将自己添加为观察者时,您将再次传递该事务付款队列。

You don't have to do anything. If you didn't get a chance to call -finishTransaction: before the app closed, then you'll be passed the transaction again next time you add yourself as an observer of the payment queue.

这篇关于在应用内购买:“恢复”已购买但尚未完成的交易的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆