The iOS 11 App Store already supports displaying in-app purchases in search results. Do you know what to look for when adding in-app purchases to your App? Today, in this article, we will talk about the process of adding internal purchase in detail with you. The main content is divided into the following aspects:

Complete agreement, tax and banking information

The addition of in-purchased goods

Add gaza box test account

The specific implementation of in-app purchase code

Notes for internal purchase

I. Fill in agreement, tax and banking information

1. Entry for agreement, tax and banking information

2. Select a contract type

After entering the page of Agreement, Tax and banking, there will be three types of contracts. If you did not actively apply for past contracts before, generally you only activate one contract of iOS Free Application now.

The page content is divided into two parts:

Request Contracts

Contracts In Effect

There are three types of contracts:

IOS Free Application contract

IOS Paid Application

IAd App NetNetwork (Advertising contract)

This article focuses on the application process for a paid application contract.

3. Apply for iOS Paid Application contract (agreement, tax and banking should be filled in)

4.Contact Info

If you have not already added a Contact, you need to Add a New Contact by using the Add New Contact button and then specify the title of the Contact. As follows:

I’m in Senior Management

Financial, finance,

Technical support

Legal: Legal

Marketing

If you’re an indie developer, you can fill it all out yourself.

5. Fill in your bank information

Select your Bank Account, if you don’t have one, click Add Bank Account next to it to Add one. Here’s how to add an account.

① Choose the country where the bank is located

② Fill in the CNAPS Code

If you do not know what the CNAPS Code is, you can search CNAPS Code on Baidu. The query will be based on three key information as follows:

Bank Name: English Name of the Bank (not pinyin)

City: The name of the City where the bank is located (Chinese cities in Pinyin)

Postal Code

After selecting the right bank, click Next to proceed to the next step.

③ Confirm bank information

④ Fill in the bank account information

Bank Account Number: Bank Account Number

Confirm Bank Account Number: Enter the Bank Account Number again

1. The Holder’s Chinese Name is spelled first and last

Bank Account Currency: Currency type, generally domestic developers choose CNY

⑤ Confirm all information

6. Fill in the tax information (this content is more)

① There are three kinds of tax information:

U. S. Tax Forms

Australia Tax Forms

Canada Tax Forms

② A bunch of treaties

I select U. S. Tax Forms, and then I will ask you two questions:

The first question asks if you are a US resident and have any US partnerships or us companies. If you do not choose No directly.

Do you have any commercial activities in the United States?

③ Then fill in your tax information, including the following:

Individual or Organization Name: indicates the Name of an Individual or Organization

Country of Incorporation: Mr

Type of Beneficial Owner: Individual for independent developers

-Leonard: Permanent Residence

Mailing address

Name of Person Making this Declaration

Title: the Title

(4) check

⑤ Forget about Australia

⑥ Don’t worry about Canada

7. Fill in the blanks

After you fill out all the documents, the contract status will change to Processing and the result will be available in about 24 hours.

Second, the addition of internal purchase goods

1. Create in-app purchases

2. Select an in-app purchase type

① Consumable goods

It is similar to diamond in the game, and currency in some apps now, such as fish balls in Douyu and tickets in Yingke. Choose consumable goods if they will be consumed.

Note: Most consumable items need to be logged in because of the inventory balance required in the data. It’s best not to show the user an item before logging in, as you may be rejected for this reason (they say luck). Xiaobian recommend you add this group: 594353854 group has hundreds of people we encounter any problem will be in the inside of communication! And free to share a set of basic iOS development information! Is a very good learning exchange place! There are also programmers to answer all kinds of problems! They soon filled up. Want to enter quickly oh! Various PDF waiting for you to download! It’s all free! Just to help you get started quickly, so xiaobian in the group waiting for you to come over and exchange learning together!

② Non-consumable goods

Items that can’t be consumed, like the video lessons mentioned above, should be available forever once purchased.

Note: When you use non-consumable items, you need to add a resume purchase button. This is common in all kinds of games, in fact, after knowing this rule is quite understandable, non-consumable goods are not consumable, once purchased lifetime use.

③ Subscription type goods

If your company is an outsourcing company and has a subscription App, be sure to submit it for review using your customer’s account! Because when there is a subscription type item in the App, note that there is, create and then delete also count, this App can not be transferred account.

Note: Apps that use or have used subscription products cannot be transferred

3. Add gaza box test account

1. Add the entrance of the gaza box test

2. Add the gaza box test account

3. Enter the test account information

Four, the specific implementation of internal purchase code

I created a buying gold COINS inside buy ApplePayCIOViewController controller. Here, I’m going to post the detailed code for.m.

1. Explain the process of internal purchase in detail

① Users first get the list of products to buy

② Payment and seal

③ Send the stamped order to your server to verify whether the payment is successful

4 Handle the fault based on the information returned by the server

Code 2.

① Import storeKit. framework libraries first

(2) create ApplePayCIOViewController, abide by the agreement < SKPaymentTransactionObserver SKProductsRequestDelegate >

(3) ApplePayCIOViewController. M code

Swipe down to see multiple images

Five, internal purchase matters needing attention

1. It usually occurs when the App is submitted for the first time or a new product is added. When your App is approved, you find that you can’t get the product in the production environment. This is because the App has been approved, but the in-app purchase product has not been officially added to Apple’s server. You just need to wait for a while

  1. _currentProId specifies the ID of your purchase item. This should be the same as the productID created in step 2. In this case, 123.

  2. After listening for purchase results, be sure to call [[SKPaymentQueue defaultQueue] finishTransaction: TRAN]; To allow you to remove transactions from the payment queue.

  3. When testing the App Store in-app purchase process in sandbox environments, use devices that are not jailbroken.

  4. Please be sure to use the real machine to test, everything is subject to the real machine.

  5. The Bundle identifier of the project must be the same as the Bundle ID entered when you applied for the App ID; otherwise, the product information will not be requested.

  6. When testing the real machine, you must log out of the original account, to use the sandbox test account

  7. Please pay attention to macro. Sandbox verification is used for testing. Sandbox purchase is also used in App Store audit, so when verifying purchase certificate, you need to return Status Code to decide whether to go to sandbox for secondary verification. If the return value is 21007, it needs to sandbox the second verification, because this purchase is in the sandbox.

9. Is your application in the Pending Developer Release state? In-app purchases waiting to be released cannot be tested.

10. Was your in-app purchase project newly created or changed recently? It takes a while for an in-app purchase project to reach all servers, typically an hour or two, but possibly several hours longer.

11. Do you have any projects in iTC for Contracts, Tax, and Banking Information that are not set or are overdue? Incomplete financial information cannot be tested for in-app purchase.

12. Are you testing in-store purchases on jailbreak devices? Jailbroken devices cannot be used for normal in-app purchase, you need to reinstall or find a device that is not jailbroken.

13. Is your application in the Rejected state or Developer Rejected? Apps in the rejected status will also be rejected for in-app purchases that have not yet passed, so you need to set the IAP items to Cleared for Sale again.

14. Is the test account you are using a US account? Although it is not necessary, it is highly recommended to use a US account given that the test accounts in other regions are often flabby and the US account has been stable. Normally iaps do not require credit card binding and other information, if you encounter this, try deleting the test account and creating a new one for another region.

15. Have you deleted the original App from the device and installed it again? If so, remember to Clean and Clean Build Folder before installation.

16. Is the content of the Bundle identifier in your PList consistent with your App ID?

Don’t finish the detailed guide here, go to your App to set up in-app purchase ~

If there is infringement, please contact xiaobian to delete!