如何使用我的服务器验证IAP收据

时间:2018-07-03 07:17:37

标签: ios objective-c in-app-purchase

我正在使用以下代码进行收据验证。

NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];

NSData *receipt = [NSData dataWithContentsOfURL:receiptURL];

if (!receipt) { 
   /* No local receipt -- handle the error. */

}

/* ... Send the receipt data to your server ... */

当我在AppDelegate中添加此代码时,默认情况下,当用户启动应用程序时,将调用appStoreReceiptURL调用并自动生成收据。我不想每次都收据。用户续订计划时,我需要该收据。任何人都知道这一点,请帮助我

0 个答案:

没有答案