如何使用appStoreReceiptURL [英] How to use appStoreReceiptURL

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

问题描述

不推荐使用transactionReceipt。
但是我无法使用,

transactionReceipt is deprecated. But I am not able to use,

[[NSBundle mainBundle] appStoreReceiptURL].

如果有收据,这应该会返回一个收据。但对我来说没有一个,因为这个值是零,而且据我所知,它不应该是。我在iOS 7上运行并且已经完成了一些应用内购买(设备上的沙盒)。

This is supposed to return a url to a receipt if there is one. But for me there isn't one, as this value is nil, and as far as I can tell it shouldn't be. I'm running on iOS 7 and have done a few in-app purchases (sandbox on the device).

任何人都可以提供帮助。

Can anyone help .

推荐答案

这会给你收据作为mainBundle的appStoreReceiptURL的内容: -

This will give you the receipt as the contents of the mainBundle's appStoreReceiptURL :-

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

一旦你将NSData转换为NSString。

Once you get that convert NSData to NSString.

有关详细信息,请参阅: -

For more details, see this :-

https://developer.apple.com/library/ios/releasenotes/General/ValidateAppStoreReceipt/Chapters/ValidateRemotely.html#// apple_ref / doc / uid / TP40010573-CH104-SW1

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

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