iyuichiの私的開発ログ

渋谷で働くWebエンジニアのログ. Java, Android, iOS, Docker, GCP, AWS, ゲーム開発

iOSの自動継続をサーバサイドだけでハンドリングできるのか??

qiita.com

latest_receipt, latest_receipt_infoというレシートのフィールドに関して、

The values of the latest_receipt and latest_receipt_info keys are useful when checking whether an auto-renewable subscription is currently active. By providing any transaction receipt for the subscription and checking these values, you can get information about the currently-active subscription period. If the receipt being validated is for the latest renewal, the value for latest_receipt is the same as receipt-data (in the request) and the value for latest_receipt_info is the same as receipt.

Validating Receipts With the App Store

こんな感じで、最新の自動継続した情報を取れると言っている一方でiOS6スタイルのレシートでだけ返される値だとも書いてあって困る。

Only returned for iOS 6 style transaction receipts for auto-renewable subscriptions.

サーバ側でレシート検証をする必要があるケースとして、複数のプラットホームで決済可能なサービスでPCやスマートフォン以外の場所でもサービスを受けられる場合にはアプリを起動しなくてもサービスの継続または停止の判定をしなくてはならないと思います。

アップルのレシートに含まれるin_appは送信したレシートが発行された時点までの履歴しか入っていない認識で、latest_receipt_infoの中には初回購入後に定期購読で自動継続されたものも取得できるはず。

その項目がiOS6までしか利用できないものだとしたら非常に困る。

You also asked “Essentially my question is this: "If a user has successfully purchased an auto-renewing subscription does that imply that the "latest_receipt" and "latest_receipt_info" fields will always be populated in the receipt validation response?"
Yes - unless there is a problem with the verifyReceipt server.

latest_receipt and latest_receipt_info fields -... | Apple Developer Forums

ここのスレッドを見る限りではアップルのエンジニアらしき人がauto-renewされるアイテムを買った場合には"latest_receipt" and "latest_receipt_info" が含まれると言っているのでiOS7以降でもサーバサイドだけで自動継続の確認ができると思って良いのかな?

UNDOCUMENTED featureだといつ変更されるかわからなくって困る。