Introduction | Overview of In-App Purchase | Retrieving Product Information | Making a Purchase
Adding a Store to Your Application | Verifying Store Receipts | Testing a Store | Auto-Renewable Subscriptions


본 페이지는 iOS In-App Purchase Programming Guide 문서의 Auto-Renewable Subscriptions 부분을 번역해 놓은 페이지 입니다. 발 번역이라 이상한 부분이 있을 수 있습니다. 발견즉시 댓글을 달아 주세요.




Auto-Renewable Subscriptions
자동갱신 구독

In-App Purchase provides a standardized way to implement auto-renewable subscriptions. Auto-renewable subscriptions have a few notable characteristics:
인 - 구매 자동 갱신 구독을 구현하는 표준화 된 방법을 제공합니다. 자동 갱신 구독을 몇 가지 주목할만한 특징이 있습니다 :

  • When you configure an auto-renewable subscription in iTunes Connect, you also configure the duration for the subscription and other marketing options.
    iTunes에서 자동 재생 구독을 연결 구성 할 때, 당신은 또한 가입 및 기타 마케팅 옵션에 대한 기간을 구성합니다.

  • Auto-renewable subscriptions are restored automatically using the same Store Kit functions used to restore non-consumable products. The original purchase transaction as well a transaction for each renewal are sent to your application. See “Restoring Transactions.”
    자동 재생 구독은 비 소모품 제품을 복원하는 데 사용 된 것과 동일한 저장소 키트 기능을 사용하여 자동으로 복원됩니다. 갱신 원래 구입 거래뿐만 아니라 트랜잭션이 응용 프로그램에 전송됩니다. "트랜잭션 복원"을 참조하십시오.

  • When your server verifies a receipt with the App Store and the subscription is both active and has been renewed by the App Store, the App Store returns an updated receipt to your application.
    서버가 앱 스토어가입영수증을 확인하면 활성 둘 다앱 스토어갱신되었습니다 앱 스토어 응용 프로그램에 업데이트 된 영수증을 반환합니다.

Adding Auto-Renewable Subscriptions to Your Store
귀하의 저장소에 자동 재생 구독 추가

To implement auto-renewable subscriptions, follow these steps:
자동 갱신 구독을 구현하려면 다음 단계를 수행하십시오 :

  • Connect to iTunes Connect and use it to create a new shared secret. A shared secret is a password that your server must provide when validating receipts for auto-renewable subscriptions. This shared secret provides an additional layer of security to your transactions with the App Store. See iTunes Connect Developer Guide.
    아이튠즈 연결하고 새 공유 암호를 만드는 데 사용하는 연결합니다.공유 비밀 자동 재생 구독에 대한 영수증을 확인할 때 서버가 제공해야하는 암호입니다. 이 공유 비밀은 앱 스토어거래에 대한 보안의 추가 계층을 제공합니다. iTunes에서 개발자 가이드 연결을 참조하십시오.

  • Configure new products in iTunes Connect with the new auto-renewable subscription type.
    iTunes에서 새로운 제품을 구성하는 새로운 자동 재생 구독 유형 연결합니다.

  • Modify your server’s receipt verification code so that it adds the shared secret to the JSON data it sends to the App Store. Your server’s verification code must parse the response to determine whether the subscription has expired. If the subscription has been renewed by the user, the most current receipt is also returned to your server.
    그것은 앱 스토어로 전송 JSON 데이터를 공유 암호를 추가하도록 서버의 영수증 검증 코드를 수정합니다. 서버의 인증 코드는 구독이 만료되었는지 여부를 결정하기 위해 응답을 구문 분석해야합니다.구독이 사용자에 의해 갱신 된 경우, 가장 최신의 영수증서버에 반환됩니다.

Designing your Client Application
클라이언트 응용 프로그램을 설계

In most cases, your client application should require minimal changes to support auto-renewable subscriptions. In fact, your client application is now made simpler, as you can use the same code to recover auto-renewable subscriptions as you do to recover non-consumable products. Your application receives a separate transaction for each period of time where the subscription was renewed; your application should verify each receipt separately.

대부분의 경우, 클라이언트 응용 프로그램이 자동 갱신 구독을 지원하기 위해 최소한의 변경을 필요로합니다. 사실, 클라이언트 응용 프로그램은 이제이 아닌 소모품 제품을 복구 대로 자동 갱신 구독을 복구하는 동일한 코드를 사용할 수있는, 단순 해졌습니다. 응용 프로그램 등록이 갱신 시간각 기간에 대해 별도의 트랜잭션을 수신합니다 응용 프로그램이 각각 별도로 영수증을 확인해야합니다.

Verifying an Auto-renewable Subscription Receipt
자동 재생 구독 영수증 확인

Verifying a receipt for an auto-renewable subscription is almost identical to the process described in “Verifying Store Receipts.” Your application creates a JSON object and posts it to the App Store. The JSON object for an auto-renewable subscription receipt must include a second parameter — the shared secret you created earlier on iTunes Connect:

자동 재생 구독에 대한 영수증을 확인하기에 설명 된 프로세스와 거의 동일합니다 "상점 영수증 확인."응용 프로그램JSON 개체와 앱 스토어에 게시만듭니다.자동 재생 구독 영수증 JSON 객체는 두 번째 매개 변수가 포함되어야합니다 - 만약 당신이 이전에 아이튠즈 연결에서 생성 된 공유 비밀 :

{
    "receipt-data" : "(receipt bytes here)",
    "password"     : "(shared secret bytes here)"
}

The response includes a status field that indicates whether the receipt was successfully validated.
응답 영수증의 유효성 검사가 성공적으로 완료되었는지 여부를 나타내는 상태 필드가 포함되어 있습니다.

{
    "status" : 0,
    "receipt" : { (receipt here) },
    "latest_receipt" : "(base-64 encoded receipt here)",
    "latest_receipt_info" : { (latest receipt info here) }
}

If the user’s receipt was valid and the subscription is active, the status field holds 0, and the receipt field is populated with the decoded receipt data. If your server receives a non-zero status value, use Table 7-1 to interpret non-zero status codes.

사용자의 접수가 유효이고 가입이 활성 상태 인 경우, 상태 필드는 0보유하고 영수증 필드는 디코딩 영수증 데이터로 채워집니다. 서버가 아닌 상태 값을 수신하면 0이 아닌 상태 코드를 해석하는 표 7-1를 사용합니다.

Table 7-1  Status codes for auto-renewable subscriptions

Status Code

Description

21000

The App Store could not read the JSON object you provided.

21002

The data in the receipt-data property was malformed.

21003

The receipt could not be authenticated.

21004

The shared secret you provided does not match the shared secret on file for your account.

21005

The receipt server is not currently available.

21006

This receipt is valid but the subscription has expired. When this status code is returned to your server, the receipt data is also decoded and returned as part of the response.

21007

This receipt is a sandbox receipt, but it was sent to the production service for verification.

21008

This receipt is a production receipt, but it was sent to the sandbox service for verification.

The receipt field on the JSON object holds the parsed information from the receipt. The receipt data for an auto-renewable subscription includes one additional key, and some other key previously described in Table 5-1 are modified slightly for subscriptions. See Table 7-2 for details on the new and modified keys.

The receipt field on the JSON object holds the parsed information from the receipt. The receipt data for an auto-renewable subscription includes one additional key, and some other key previously described in Table 5-1 are modified slightly for subscriptions. See Table 7-2 for details on the new and modified keys.

Table 7-2  Auto-renewable subscription info keys

Key

Description

expires_date

The expiration date of the subscription receipt, expressed as the number of milliseconds since January 1, 1970, 00:00:00 GMT.

original_transaction_id

This holds the transaction identifier for the initial purchase. All subsequent renewals of this subscription and recovered transactions all share this identifier.

original_purchase_date

This holds the purchase date for the initial purchase; it represents the start date for the subscription.

purchase_date

This holds the billing date when this transaction occurred. For a transaction for a renewable subscription, this would be the date when the subscription was renewed. If the receipt being parsed by the App Store was the latest receipt for this subscription, this field holds the date when this subscription was most recently renewed.

In addition to the receipt_data field, the response may also include two new fields. If the user’s subscription is active and was renewed by a transaction that took place after the receipt your server sent to the App Store, the latest_receipt field includes a base-64 encoded receipt for the last renewal for this subscription. The decoded data for this new receipt is also provided in the latest_expired_receipt_info field. Your server can use this new receipt to maintain a record of the most recent renewal.

receipt_data 필드 또한, 응답은 또한 두 개의 새로운 필드를 포함 할 수 있습니다.사용자의 가입이 활성화되고 서버가 앱 스토어로 전송 수령 후 일어났다 트랜잭션에 의해 갱신 된 경우, latest_receipt 필드는이 구독에 대한 최종 갱신 base-64로 인코딩 된 영수증을 포함하고 있습니다. 이 새로운 영수증에 대한 디코드 된 데이터는 latest_expired_receipt_info 필드에 제공됩니다. 서버가장 최근에 갱신의 기록을 유지하기 위해이 새로운 영수증을 사용할 수 있습니다.

Posted by 창업자닉군
,