使用appStoreReceiptURL还原非续订 [英] Using appStoreReceiptURL to restore non-renewing subscription

查看:189
本文介绍了使用appStoreReceiptURL还原非续订的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用appStoreReceiptURL获得的收据来检索非续订订阅的购买日期.对于非续订订阅,我可以从购买日期开始计算到期日期.

I can use the receipt obtained by appStoreReceiptURL to retrieve the purchase date of non-renewing subscription. For non-renewing subscription, from the purchase date I could calculate the expiration date.

但是当我尝试使用appStoreReceiptURL进行还原时.我发现即使在使用相同Apple ID登录的情况下也没有进行购买的设备返回零.

But when I try to restore using appStoreReceiptURL. I found that it returns nil on devices that did not make purchase even signing in with the same Apple ID.

使用

[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];

无法更新appStoreReceiptURL中的收据.我在这里做错了吗?还是无法以这种方式恢复收据?

cannot update the receipts in appStoreReceiptURL. Did I do anything wrong here? Or is it just not possible to restore the receipts this way?

谢谢

推荐答案

您不能以尝试的方式还原事务,因为它们是消耗品,并且消耗品的寿命有限.

You cannot restore the transactions in the way you are trying as they are consumables, and consumables have a finite life.

但是,您可以解析收据,并据此计算订阅期限.

However, you could parse the receipt, and calculate the subscription period from this.

收据将位于主捆绑包中,但可以使用

The receipt will be in the main bundle, but can be refreshed by using

recreq = [[SKReceiptRefreshRequest alloc] init];
        [recreq setDelegate:self];
        [recreq start];

这篇关于使用appStoreReceiptURL还原非续订的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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