COCOS2DX use iOS to pay IAP details process-in vain

Source: Internet
Author: User

Today summed up the Cocos2d-x use iOS to pay the IAP of the detailed process, encapsulated the call interface, code and detailed instructions in this http://download.csdn.net/detail/u010229677/8156677, you can call directly.

White Original http://my.csdn.net/u010229677

1, AppStore information perfect

First of all, there must be a developer account that can release the product, there is a development environment that can run the application, the IAP can only be tested by the real machine, we must have an iOS device.

Everything we do is done on the Mac, and the tests are real machines.

In the test we certainly do not want to pay the real, do not worry, in the developer account we can add a test account, simple and convenient, that is, Shahe test (SandBox).

1.1 Creating an app ID

Process I will not nonsense, the Internet can easily search a lot of, the new app ID default is to open the IAP payment,


Pre-preparation work is the same as not using IAP, after the creation of the application is done, make sure everything is correct, it is recommended not to add the IAP test, see if the project can pass the test, ready to create an IAP pay entry on the line.

1.1 Create an IAP paid entry

Enter Itunse Connect, go to my apps, click on the newly created project, click In-app purchses, enter IAP,



Click "Create new" in the top left corner to create a new IAP payment item, and the next select Type interface will have 5 IAP types to choose from.



There are four choices of type selection:

1.Consumable (consumable): Each download requires a fee;

2.non-consumable (non-consumable): Only one payment is required;

3.auto-renewable subscriptions: Automatic subscription;

4.Free Subscription: Free Subscription

If there is only a free subscription in the type selection, it means that our developer account does not have a bank card payment function.

In general, we need to buy coins in the game, such as the choice of the first kind of consumable, after the choice of this looks like




Choose Chinese can, some people say Chinese do not need to choose English, finally save on the line.



The paid entry you need to create now is complete.

1.3 Creating a Sandbox test account

Click on the users and roles in Itunse Connect and click on the sandbox after entering testers



Click the plus sign to add a

Choose the app Atore territory, choose China on the line, we test the time to play out the purchase information will be the text of the country you selected. Create a complete save.

2. IAP Access Project

I encapsulated what I needed, called directly, with comments in the code.

We need to add storekit.framework to this library in our project.

How to use:

iosiap_bridge* Bridge = new Iosiap_bridge ();

bridge->requestproducts (int);

COCOS2DX use iOS to pay IAP details process-in vain

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.