概要
<SKPaymentQueue: 0x282b3a740>: Payment completed with error: Error
Domain=ASDErrorDomain Code=500 "Unhandled exception" UserInfo=
{NSUnderlyingError=0x2827c4330 {Error Domain=AMSErrorDomain Code=301
"Invalid Status Code" UserInfo={NSLocalizedDescription=Invalid Status
Code, AMSURL=https://sandbox.itunes.apple.com/WebObjects/MZBuy.woa/wa/
inAppBuy?REDACTED, AMSStatusCode=500, NSLocalizedFailureReason=The
response has an invalid status code}}, storefront-country-code=JPN,
client-environment-type=Sandbox, AMSServerErrorCode=0,
NSLocalizedFailureReason=An unknown error occurred,
NSLocalizedDescription=Unhandled exception}
[error] ERROR: 🍎‼️ There was a problem with the App Store.
ERROR: 💰 Product purchase for 'XXXX' failed with error: Error
Domain=RevenueCat.ErrorCode Code=2 "There was a problem with the App
Store." UserInfo={NSLocalizedDescription=There was a problem with the
App Store., NSUnderlyingError=0x28272d320 {Error Domain=SKErrorDomain
Code=0 "不明なエラーが起きました" UserInfo={NSLocalizedDescription=不明
なエラーが起きました, NSUnderlyingError=0x28272ca20 {Error
Domain=ASDErrorDomain Code=500 "Unhandled exception" UserInfo=
{NSUnderlyingError=0x2827c4330 {Error Domain=AMSErrorDomain Code=301
"Invalid Status Code" UserInfo=0x280709c80 (not displayed)},
NSLocalizedDescription=Unhandled exception, NSLocalizedFailureReason=An
unknown error occurred}}}}, readable_error_code=STORE_PROBLEM,
source_file=RevenueCat/SKError+Extensions.swift:64,
source_function=asPurchasesError}
Unity に RevenueCat を導入して iOS のサンドボックス環境で
サブスクリプションを購入しようとしたところ、
上記のエラーが発生して購入に失敗する現象に遭遇した
App Store Connect でサブスクリプションの設定を見直してみたところ、
以下の 2 つの不備が見つかったので修正した
- サブスクリプション期間が設定されていなかった
- サブスクリプション期間を正しく設定した
- ステータスが「メタデータが不足」になっていた
- サブスクリプションのスクリーンショットに仮の画像を設定した
上記 2 つの不備を修正したことでステータスが「送信準備完了」に変化したため
少し時間を置いてから購入してみたら正常に購入が完了した