Cocos2dx IAP payment process in ios-in vain, cocos2dxiap

Source: Internet
Author: User

Cocos2dx IAP payment process in ios-in vain, cocos2dxiap

Today summarized the cocos2d-x Using ios payment iap detailed process, encapsulated call interface, code and detailed instructions in this http://download.csdn.net/detail/u010229677/8156677, you can directly call.

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

1. Complete appstore Information

First, there must be a developer account that can publish products, and a development environment that can run applications. IAP can only be tested on a real machine, and we must have an IOS device.

All the operations we perform are performed on the mac and the tests are real machines.

During the test, we certainly don't want to pay for it. Don't worry. In the developer account, we can add a test account, which is simple and convenient, that is, SandBox ).

1.1 create an app ID

I won't talk nonsense about the process. I can find a lot of information on the Internet, and the newly created app ID enables iap payment by default,


The preparations in the early stage are the same as those for not using iap. After the application is created, make sure everything is correct. We recommend that you do not add an iap to test whether the project can pass the test, after everything is ready, you can create an iap billing entry.

1.1 create an iap billing entry

Go to iTunse Connect, go to my apps, click the newly created Project, and click In-App Purchses to enter iap,



Click "Create New" in the upper left corner to Create an IAP payment project. The Select Type page will show 5 medium IAP types available for selection.



You can select four types:

1. Consumable (consumables): Each download is billed;

2. Non-consumable (Non-consumable): pay only once;

3. Auto-Renewable Subscriptions: automatic subscription;

4. Free Subscribe: Free Subscription

If the type is selected for free subscription, it means that our developer account has not activated the bank card payment function.

In general, if we need to buy gold coins or the like in the game, we should choose the first Consumable. After we select it, it will look like this.




Select Chinese. If someone says Chinese, they do not need to select English. Just save it.



Now you have created a payment option.

1.3 create a sandbox test account

Click users and roles in iTunse Connect, and then click sandbox testers.



Click the plus sign to add

When you select app atore territory, you can select China. The text of the purchase information popped up during the test will be the text of the country you selected. After creation, save the settings.

2. iap Access Project

I encapsulated what I needed and called it directly. There are comments in the code.

Add the StoreKit. framework library to our project.

Usage:

IOSiAP_Bridge * bridge = new IOSiAP_Bridge ();

Bridge-> requestProducts (int );

 

Related Article

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.