CelerX Gaming SDK

CelerX Gaming SDK

›iOS Game SDK

Getting Started

  • Guide

HTML5 Game SDK

  • Guide
  • HTML5 Solo Game
  • HTML5 Turn-based Game
  • HTML5 Turn-based Game (Smart Contract Enabled)

iOS Game SDK

  • Native iOS Game Integration Guide

Unity Game SDK

  • Unity Game iOS Integration Guide
  • Unity Game Android Integration Guide

Game Design Best Practice

  • Best Practice

Native iOS Game Integration Guide

This doc introduces the integration steps for native iOS games.

Refer to our demo for some references

Demo Repo (2048)

Create Your Games at the portal

Game Developer Portal

Please referer to our Assets Guide when uploading your

Make Sure the bundle id is correct since that will be your key to your game info Screen Shot 2020-09-17 at 5 12 40 PM

Download Necessary Depedencies

Use the shell script from our Demo Repo

-- Debug

sh downloadLibs.sh

-- Release

sh downloadReleaseLibs.sh

It will download all the required dependencies for CelerGameSDK

Project setup for compiling

  • Embed everything from the dependencies folder

embedLibs

  • Change Celersdk.framework to Do not embed

linkCelerSdk

  • Disable bitcode(Due to one of the embeded library, might change in the future)

disableBitCode

  • Add Your Resource Bundle(Optional, but will speed up your launch process)
  • Add Your GoogleService-Info.plist(Push Notification)

resourceBundle

  • Register your BundleId with our portal

bundleId

  • Add necessary permissions

Prerequisites

--

  • Necessary Assets grphicAssetsIntegration.pdf

  • Push Certificates

Permissions

PermissionReason
LocationRequired by law when play real money game
MicrophoneUsed by Instabug
AlbumAllow user to upload profile pictures
iCloudBack up user wallet
keychain groupban potential cheaters
Apple paypayment
Push notificationmessage
CameraAllow user to upload profile pictures
Bluetooth Peripheralsrequiredfrom a payment vendor
Universal LinkPromotions

-- Camera, Alnum and Bluetooth Peripherals are required for appstore submission, Location is required for real money games

Integrate with our sdk

Import Framework

#import <CelerGameSdk/CelerGameSdk.h>

Init SDK

[CelerGame initializeSdk];

-- Try not to call this function at app's start or start of your first view, do this when you have passed your initial loading screen, and preferably being trigger by user action, delay one runloop if you'll have to present sdk UI at launch

Register Celer Game SDK Life Cycle

[CelerGame setSdkDelegate:self];

CelerSdkDelegate

- (void)matchSeedGenerated:(double)seed

- (void)onMatchJoin:(nonnull id)gameObject

- (void)onReady

- (void)onResult

matchSeedGenerated

This callback provides a double type seed in order to generate a random level fair to the players, seed will range from 0 ~ 1

onMatchJoin:gameObject

This callback provides necessary infomation about the match in a json package, display info as fit

gameObject

For Objective C, gameObject will be a dictionary formatted as below:

{
   "matchId":"01b085ed-b928-4476-a6ff-924c18fbf0d8",
   "players":[
      {
         "id":"sand.siesta",
         "index":1,
         "name":""
      },
      {
         "id":"pear.penury",
         "index":2,
         "name":""
      }
   ],
   "sharedRandomSeed":0.99951094382847394,
   "shouldLaunchTutorial":true,
   "difficultyLevel":1,
   "currentPlayer":{
      "id":"pear.penury",
      "index":0,
      "name":""
   }
}

onReady

Start your game here

onResult

Do some clean up work

CelerGameSdk method

[[CelerGame shared] sendWithCallback:CelerGameStateOnLoaded];

[[CelerGame shared] sendWithCommand:CelerGameCommandHideInterface];

[[CelerGame shared] sendWithCommand:CelerGameCommandShowInterface];

[[CelerGame shared] submitWithScore:_score];

sendWithCallback:CelerGameStateOnLoaded

call this function when game level has finished loading

sendWithCommand:CelerGameCommandHideInterface

hide CelerGameSDK UI

sendWithCommand:CelerGameCommandShowInterface

show CelerGameSDK UI

submitWithScore:int

submit Score

Notes

  • To run this demo, run download script in the root directory
  • An universal framework that supports simulator and devices will be provided, it will run on a debug environment
  • A release framework only supports devices will be provided for appstore, it will run on release configuration
  • For a pure OC project target before ios 12.2, please enable Always Embed Swift Standard Libraries settings [https://stackoverflow.com/questions/55364816/with-swift-5-and-ios-12-2-should-i-change-always-embed-swift-standard-librarie]
  • Minimuim sdk requirement is iOS 11
← HTML5 Turn-based Game (Smart Contract Enabled)Unity Game iOS Integration Guide →
  • Refer to our demo for some references
  • Create Your Games at the portal
  • Download Necessary Depedencies
  • Project setup for compiling
  • Prerequisites
  • Permissions
  • Integrate with our sdk
    • Import Framework
    • Init SDK
    • Register Celer Game SDK Life Cycle
    • CelerSdkDelegate
  • matchSeedGenerated
  • onMatchJoin:gameObject
  • gameObject
  • onReady
  • onResult
    • CelerGameSdk method
  • sendWithCallback:CelerGameStateOnLoaded
  • sendWithCommand:CelerGameCommandHideInterface
  • sendWithCommand:CelerGameCommandShowInterface
  • submitWithScore:int
  • Notes
CelerX Gaming SDK
Docs
Getting Started
Community
Project ChatTwitter
More
BlogGitHub
Copyright © 2020 Celer Network