2. How to achieve internal purchase
Internal Purchase Overview:
In-game shopping refers to the player in the game, using money to obtain a game props a way. Developers get the benefit of the development game from the player's purchase, so a lot of games have an inside purchase module. Below we take on the mobile phone iOS platform to achieve cool game inside purchase For example, introduce the game inside the basic process of purchase.
Principle:
The internal purchase flowchart, as shown in Figure 2-1.
Figure 2-1
Implementation method:
Step 1:
The developer will put the items on the shelves. Register Mpid with a built-in developer account on Game Center, which includes information on items on the shelves: name, number, and price. Before the product is on the shelves, developers need to register as iphone develop on the iphone devcenter. If not, it takes a $99.00 to buy an account at Apple's official register. Register the original account and the shelf products can refer to Apple's official website: https://developer.apple.com.
Step 2:
The production of the UI. This piece on the developer's custom design, the general content is: button, prop name, props information and so on.
Step 3:
The realization of the internal purchase.
The 3.1 engine provides an interface invoke function with the App Store. The flowchart of the player buying props in the game, as shown in Figure 2-3-1-1. In the process implementation, the developer only needs to add the following section of code.
The internal purchase flowchart, as shown in Figure 2-3-1-1.
Figure 2-3-1-1