不推荐使用的TransactionReceipt [英] Deprecated TransactionReceipt

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

问题描述

我正在使用此代码进行应用内购买,从RaywernderLich的教程中获取。

I am using this code for in-app purchases, took it from RaywernderLich's tutorial.

// Encode the receiptData for the itms receipt verification POST request.
NSString *jsonObjectString = [self encodeBase64:(uint8_t *)transaction.transactionReceipt.bytes
                                         length:transaction.transactionReceipt.length];

现在Xcode说


'transactionReceipt'已被弃用:首先在iOS 7.0中弃用

'transactionReceipt' is deprecated: first deprecated in iOS 7.0

如何解决?

推荐答案

替换为:

[NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]];

NSData 转换为 NSString 之后......

Convert NSData to NSString after that.....

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

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