LoginSignup
28
23

More than 5 years have passed since last update.

ios 課金認証レシートの空in_appについて

Posted at
{
   "status":0,
   "environment":"Production",
   "receipt":{
      "receipt_type":"Production",
      "adam_id":842291255,
      "bundle_id":"xxxxxxxxxxx",
      "application_version":"1",
      "download_id":85005636092973,
      "request_date":"2014-04-17 13:58:48 Etc/GMT",
      "request_date_ms":"1397743128187",
      "request_date_pst":"2014-04-17 06:58:48 America/Los_Angeles",
      "original_purchase_date":"2014-04-17 13:45:01 Etc/GMT",
      "original_purchase_date_ms":"1397742301000",
      "original_purchase_date_pst":"2014-04-17 06:45:01 America/Los_Angeles",
      "original_application_version":"1",
      "in_app":[

      ]
   }
}

iOS課金の認証時、こんレシートと合ったら、レシート自体は、OKですが、in_appが空なので、課金が発生していません。なので、in_appが空の場合、NGです。

下記は、apple developerへの問い合わせと回答です。同じ悩みにあった方、ご参考ください。

問い合わせ

In my production environment, I get many receipt with empty in_app field like this from "https://buy.itunes.apple.com/verifyReceipt".
I want to know if it's ok to deal the empty in_app as an invalid purchase receipt.

I found the same question at here.
https://devforums.apple.com/message/959729#959729

Look forwarding with your answer.
Thank you.

回答

I’m responding to your questions regarding you finding that the validation of the universal app receipt shows that the in app array is empty - you asked -
"I want to know if it's ok to deal this as an invalid purchase receipt.”
Response - first let me clarify, the validation of the receipt shows that this is a valid receipt - however, the fact that the in_app array is empty, indicates that the StoreKit has not recorded a transaction. If your app receives such a receipt upon a “successful” transaction, then before the application acknowledges the transaction (by calling finishTransaction), the app can indicate to the user that there appears to have been a problem with the receipt and ask to refresh the receipt. Upon agreement - the app can make the SKReceiptRefreshRequest method - wait for the response and check the receipt.

If the universal app receipt continues to have an empty in_App array, no purchase has been processed by the StoreKit. Several responders to the developer forum posting you mentioned suggested that the app may have been running on a jailbroken device. That would be the only explanation I can think of at this time to cause this behavior.

A different way to answer your question - I would not provide content until there is an item in the in_app array. However make sure to give the user a chance to refresh the receipt in the case that there was a network glitch.

28
23
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
28
23