FAQs for in-app purchases (In-app Purchase)

Source: Internet
Author: User
Tags hosting

Http://www.cocoachina.com/ios/20150612/12110.html

This document gives you answers to frequently asked questions about in-app purchases.

Configuration (config)

1. Do I have to upload a binary file to test in-app purchases?

No, testing in-app purchases (In-app Purchase, hereinafter referred to as IAP) does not require uploading binary files.

Note: Do not upload binary files in development to itunes Connect until the application is ready for approval. If the binary file appears in itunes Connect, but the feature is incomplete, then app review will review the binaries and will most likely reject the file. In itunes Connect, if the app review rejects the latest binaries, the test IAP will fail. One workaround is to upload binary files without the IAP feature via app Review. Once the binaries are approved, you can test the IAP functionality.

2. How do I enable a wildcard app ID to support IAP?

Refer to the following steps:

    • Identify the current bundle ID in Xcode or itunes connect to confirm the app. For more information, see the About Bundle IDs.

    • Refer to Steps 1-6 and 8-10 in registering app IDs to update the wildcard app ID to support IAP.

3. What is the minimum version of the product that supports automatic subscription?

    • iOS System: iOS 4.2

    • OS system: OS X 10.9

4. When to use the Skpaymentqueue Restorecompletedtransactions method?

In the following two cases, you can only use Skpaymentqueue's Restorecompletedtransactions method to recover automatic subscriptions or non-expendable items:

1. Install them on other consumer-owned devices.

2. Reinstall the associated applications on the device they were removed from.

5. How many IAP item IDs can I create for each app in itunes Connect?

Read configuring a product to find the answer.

Error message (Messages)

1. Your account information has been changed (Your accounts info has changed)

Because you are using a test account when you log on to the App Store on your device, you will receive a "Your account information has been changed" message. Once you use this account to log in to the product purchase environment, the sandbox will detect that your user account is not available. To resolve this issue, you need to exit your current account in the setup application of your device, create a new test account in itunes Connect, and use this account when the store kit prompts to confirm the purchase from within your app.

2. Cannot connect to the itunes Store (cannot connect to itunes Store)

The "Cannot connect to ITunes Store" issue may be caused by one or more of the following reasons:

    • The sandbox is not up to the box.

    • Your application does not have bundle version (Cfbundleversion). For more information, see Setting the Version number and Build String

    • Your application is running on the emulator and does not support in-app purchases.

    • The item you are trying to buy is not in the list of sale. For more information, see Query the App Store for product information before presenting your app ' s store UI

3. The Apple ID is not yet available in the itunes Store (this Apple ID have not yet been used in this itunes store)

Receiving this message means that you have logged into the itunes Store using your test account. To resolve this issue, you need to exit your current account in the Settings app on your device, create a new test account in itunes Connect, and use this account when the store kit prompts to confirm the purchase from within your app.

4. You have purchased the item, click OK again to download the product for free (you ' ve already purchased this. Tap OK to download it again for free)

This message is not a notification and not an error prompt. It means that you are buying a non-expendable item that has already been purchased. You do not have to pay for non-expendable items that you have already purchased.

5. You have purchased the in-app purchases, but have not yet downloaded (you've already purchased this In-app Purchase but it hasn ' t been downloaded)

The message was received because you did not call Skpaymentqueue's Finishtransaction:method method in the application. Call Finishtransaction: Method to delete a transaction from the purchase queue.

6. The account does not have a test account, please create a new account in the sandbox environment (this is the not a test user accounts. Please create a new account in the Sandbox environment)

When the store kit prompts you to confirm your purchase, you will receive this message when you sign in with your itunes account. To resolve this issue, you need to exit the App store from the Settings app in your device and use the sandbox to test your user account when the store kit prompts to confirm the purchase from within your app.

Localization (Localization)

In itunes Connect, my in-app purchases are native to many languages. However, the localizeddescription and Localizedtitle properties always return information in English, even if the language of the test device is not English.

The localized information language returned by Localizeddescription and Localizedtitle is based on the language of the current itunes store and not the current device. For example, in itunes Connect, your in-app purchase is localized for German, but you log in with an English test account, and both Localizeddescription and Localizedtitle return information in English. If you need to return German information, use the German test account on your test device to log in.

Receipt

1. Which URL should I use to verify receipt? (what URL should I use to verify my receipt?)

    • When you test your application in a sandbox and the application is in an audit state, use the sandbox url:https://sandbox.itunes.apple.com/verifyreceipt

    • Use the product Url:https://buy.itunes.apple.com/verifyreceipt when the app is approved by the App Store

Note: Make sure that the receipt that the application uses for authentication is sent to the app Store.

Be sure to use the product URL to verify your receipt, and if you receive a 21007 status code, then use sandbox URL validation. By following this step, you can avoid switching between URLs when the app is under test or in a sandbox environment, or in the app Store on the shelf.

21007 status code indicates that the receipt is a sandbox receipt, but has been sent to the commodity service for verification. The 0 status code indicates that the receipt has been correctly validated.

2. The current receipt is invalid or does not match the current user ID (receipt invalid or mismatched DS Person ID)

You receive this message because the OS X app Store receipt is missing from your application. For more information on how to get Receipt from an application, see: Receipt Validation Programming Guide

3.Receipt authentication failed with a status of < A string of numbers > (Verifying my receipt fails with a status of)

Possible causes:

    • In the iOS app, you don't encode the receipt data using Base64 encoding.

    • The object published to the App Store is not in JSON format. Listing 1 is the correct JSON object for automatic subscription:

Listing 1 Verifying the valid receipt example of an automatic subscription:

1234 {    "receipt-data""...",        "password""..."}

4. App audits cannot view the catalogs that have been purchased successfully

If your app validates receipt through the App Store after a successful purchase, check to see if your app uses the correct app store URL to verify receipt. For more information please see what URL should I use to verify my receipt?

5. After the purchase is successful, my application uses paymentqueue:updatedtransactions: Verify receipt. However, the returned receipt contains an empty In_app array instead of the expected product.

An empty In_app array indicates that the store kit does not record any transactions for the current user. Perhaps there is no update to the application receipt, if so, the application can notify the user that the receipt has not appeared and whether to refresh. If the user agrees, the application uses the Skreceiptrefreshrequest class to update the receipt. At this point, if the store kit has logged the user's purchase information, the application receipt will be displayed in the In_app array. For more information on how to update Receipt, please see: Refreshing the App Receipt

Subscribe (subscriptions)

1. You cannot upload hosted content to itunes Connect using Xcode 6

This is a bug that exists at the moment. To resolve this issue, use the application loader to upload the package containing the managed inside. The steps are as follows:

    • In Xcode Archives Organizer, select the document that contains the managed content.

    • Click Export

    • In the popup dialog box, select Export as an Installer package.

    • Click Next to start building your package, and then select Export to save your package (a file with a. pkg file name extension).

    • Upload this package using application Loader for more information see: Using Application Loader

The demo generates a package for managed content, and the numbers in the figure correspond to the above steps.

2. How do I change from an automatic Update subscription service to an IAP item?

Refer to the following steps:

    • Turn off the clear for sale flag in itunes Connect to remove the item/service from the current auto-update subscription and remove it from your code. Automatic Updates to the goods/services will be banned and a message will be sent to the user. Remember, you must provide the user with a paid product/service until the subscription is terminated. In addition, items/services that were previously automatically updated are recoverable. For example, if your user purchased a one-month subscription on April 1, but the subscription will be rolled out on April 19, you must also provide the purchased content until May 1.

    • Create a new IAP product type, and then update the binaries to use it. For more information, see: Creating In-app Purchase Products

Note: This step is required because once the in-app purchase type is created, it can no longer be changed.

3. Verify the application receipt through the App Store and analyze whether you need to provide relevant functionality to your users. For more information, see: Receipt Validation Programming Guide

3. How do I know if a user has shared their contact information with me?

Use the subscription expiration Date (expires_date) field in receipt to detect whether the user has shared their information with you.

If you decide to offer a 7-day free trial for customers who purchase a one-month subscription service and are willing to share personal information, the store kit will provide you with a receipt, the receipt Expires_date store for 7 days plus 1 months of length. After your first purchase, your subscription will expire in 7 days of January and will be turned on for automatic Updates every month thereafter.

4. My application does not receive any automatic update reminders even when it is running in the foreground

If your application has a stable trading observer, it will receive all automatic update reminders when it is opened or restored from the background. For more information, see: ADD a transaction queue observer at application launch

Troubleshooting (troubleshooting)
1. Why is my product identifier returned in the Invalidproductidentifiers array?

Perhaps because of one or more of the following reasons:

1. The explicit App ID is not used.

2. In itunes Connect, Apple rejects your latest binary code submitted to itunes connect.

3. You did not clear the IAP products that are on sale in itunes Connect.

4. You have not registered your application with the provisioning profile associated with the correct app ID.

5. The product may have been modified, but these changes are not in effect on all the App Store servers.

6. Failure to complete all financial needs statement. For more information, see: Contracts, tax, and Banking

7. Your product is hosted by Apple and the content has not been uploaded to itunes Connect. For more information on uploading managed content, see: Hosting non-consumable products with Apple

Note: Your product identifiers will not be valid until the contents of the product are uploaded to itunes Connect. If the content is not ready, you can disable the hosting content with Apple feature in itunes Connect to resolve this issue. Once the content is ready to be uploaded, you can re-enable the feature.

8. The product identifier specified in itunes Connect does not match the identifier used by the Skproductsrequest object in the application. For more information on product identifiers, see: Technical q&a, QA1329, ' In-app Purchase product Identifiers '.

2. The Restorecompletedtransactions method that calls the payment queue cannot recover any items in the app

may be caused by one or more of the following reasons:

1. Your product has unfinished business. If there are outstanding transactions in the pay queue, the recovery process does not return the item. For more information on closing a transaction, please see: Finish the transaction.

2. You do not have any previously purchased non-consumable, automatic Update subscriptions, and free subscription items.

3. Non-update subscriptions or consumable items that you are trying to recover are not recoverable types. The Restorecompletedtransactions method only restores non-consumable items, automatic Update subscriptions, and free subscription items.

Note: In the absence of recoverable products, the Store kit does not call the Paymentqueue:updatedtransactions: method.

4. The application's build number (cfbundleversion) did not follow the development Guide to create the version number. Cfbundleversion is a string of three unsigned integers separated by a dot number. For more information, see: Setting the Version number and Build String.

Reference:

APP Distribution Guide

ITunes Connect Developer Guide

In-app Purchase Programming Guide

Receipt Validation Programming Guide

Getting Started with In-app Purchase on IOS and OS X

Technical Note TN2387 In-app Purchase Best Practices

In-app Purchase Configuration Guide for ITunes Connect

Technical q&a, QA1329, ' In-app Purchase Product Identifiers '

FAQs for in-app purchases (In-app Purchase)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.