iPhone iOS App
No part of this help document may be reproduced, transmitted, copied, stored in a retrieval system, or translated into any language in any form or by any means, electronic, mechanical, photocopying, recording, etc., without the prior written permission of Emoji Games.
All copyrights, confidential information, patents, design rights, and all other intellectual property rights contained herein are the sole and exclusive property of Emoji Games. The information provided herein is considered accurate and reliable.
Furthermore, Emoji Games is not responsible for the use of the game or any third-party patent or other rights infringement resulting from it.
1. Introduction
1.1. Purpose
The purpose of this document is for developers who want to integrate games provided by Emoji Games into iOS (iPhone) games/apps.
1.2. Preparation
Development tools for Mac or MacBook Pro: XCode 6.2, Target 6.0.
Operating system of mobile devices: iOS 6.0 or higher.
event_info.dat file created in the BMG Event Creator tool (provided by Emoji Games).
You need to upload the event_info.dat file to the server and obtain the direct URL of the file.
1.3. Overview
2. Configuration
2.1. Import the event_info.dat file
For inquiries about the event_info.dat file, please contact support@brandedminigames.com.
2.2. Upload the event_info.dat file to the server
After receiving the event_info.dat file, you need to upload it to the server and obtain the direct URL.
Example: http://brandedminigames.com/BMGSDK_Demo/event_info.dat
2.3. Modify Info.plist
2.3.1. Add one more URL property for the event data file
Property name: BMGEventDataUrl (up to client name specification)
Property value: This value is the URL where the event data file was uploaded.
2.3.2. Add another property for the URL scheme
Property name: BMGScheme
Property value: This is the URL scheme of the current campaign.
Example)
The URL scheme must be the same as the one registered on the campaign page of the Studio site.
2.3.3. Add URL type
The URL type entry should be as shown in the example below.
3. Implementation
3.1. Download and decode the event_info.dat file from the server
3.1.1. Download the event data file
First, you need to have the URL of the dat file containing all branded mini-game events.
Example: http://brandedminigames.com/BMGSDK_Demo/event_info.dat
To use the game demo event for testing, set the URL to the URL above. This is the event information data file for the game demo event. Alternatively, you can download this event_info.dat file and upload it to the server. The URL will be the server URL.
In the viewDidLoad method of the main viewcontroller, you need to create a method that fetches event data from the server, parses it, and stores it in memory.
3.1.2. Data decoding
When you receive a byte array from the data file on the server, this byte array is encoded and cannot be used.
The algorithm is "AES-128."
The key is "brandedminigames."
Use this code to decode the data.
3.1.3. Parser data of json data
Since you can create many events using the BMG Event Data Tool, the event information decoded from binary data to JSON data is an array list. You can select and use a specific event from the array list. In particular, it is a JSON array containing one or more JSON objects. If there are many events, you can store them using ArrayList.
JSON object information:
Field name | Description |
---|---|
start | Event start time. Format ‘MM/dd/yyyy’ |
end | Event end time. Format ‘MM/dd/yyyy’ |
status | Event status.0: Disable1: Enable |
url | Event game url |
title | Event title |
desc | Event description |
maxScore | Maximum possible score from this event game |
campaignId | ID of current campaign |
3.2. Build URL from the original URL in memory
After retrieving and decoding data from the event_info.dat file, you need to build a URL based on the URL received in the previous step to play the branded mini-game.
NSString *url = [obj valueForKey:@”url”];
The new URL is as follows.
"app_user": This is a string format. This should be the user's email address or ID obtained from the application after the user has logged in. This information is used to identify each user who participated in the event mini-game and can become a winner through this parameter. It is detected at the end of the event. If the user is not logged in or does not have an account, you need to generate a random value. This parameter is required. Example: Random value:
3.3. Play the game in a webview
3.4. Play the game using the Safari browser
3.5. Handling app-to-app communication
Override the following methods in the app delegate class (default is in the AppDelegate.m file).
These two methods should return YES.
Override and add code to the following method.
The code above handles "Safari and app" or "webview and app" communication. When the user clicks the "Close" button on the leaderboard page, this method is called to bring the app to the foreground.
3.6. How to provide rewards to application users based on event game scores
If your application or service uses its own point system (e.g., scores, mileage, or virtual currency), you can convert the user's score to the application's own point system. There are two ways to convert event game scores.
Method 1)
maxScore can be used to obtain the maximum score that can be obtained in the current event game. To convert the event game score to your own point system, you need the maximum score. Refer to the table below.
A | B | (A / B = C) | D | (C * D) |
---|---|---|---|---|
Maximum reward points allowed in the application | Maximum score of a specific event game | Constant to be converted | User's score in the event game | Converted reward points in the application |
100 | 4,000 | 0.025 | 3,600 | 90 |
450 | 1,500 | 0.3 | 350 | 105 |
10,000 | 2,000 | 5 | 1,350 | 6,750 |
Method 2)
The score range of a specific event game can be adjusted by the Emoji Games service operation team. If you want to adjust the score range of a specific event game for direct use in the reward point system, please contact the Emoji Games service operation team at support@brandedminigames.com.
Last updated