如何使用appStoreReceiptURL [英] How to use 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 :-
这篇关于如何使用appStoreReceiptURL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!