Eternals
  • Introduction
  • Eternia
    • Lore
    • Creatures System
      • Legend
      • Elementals
        • Fire
        • Nature
        • Earth
        • Water
        • Metal
      • Base Eternals
    • Space Stone
  • Alliance Mining Program
    • Getting Started
    • User Profile (Alliance Center)
      • Upgrade Account
      • Achievements
    • Mechanism
    • Reward Distribution
  • $ETNS (Eternals Stars Program)
    • The $ETNS System
  • Eternals Core
    • Eternals House
      • Mood
      • How to maintain a good pet's mood?
      • Decoration
      • Shop
    • Eternals Space
      • Missions
      • Mining Tower
      • Leaderboard
      • Refill Plasma
  • Eternals World
    • Gomoku
      • Game modes: Classic and Eternians
      • Battle Deck
      • Quick Match
      • Ranking Match
      • How to earn Tickets
      • How to join Eternals Gomoku
      • Missions
      • Daily Login
      • Mastery Points
      • Win Streak
      • Pet Skills
      • Leaderboard and Reward Pools
  • ETER Token
  • How To Earn With Eternals?
  • Official Links
    • Website
    • Twitter
    • Discord
    • App Store
    • Google Play
  • GDK Documentation
    • Ninety Eight Game Development Kit
    • Introduction
    • Unity
      • GDK Installation Guide
      • Update Guide
      • Examples
      • Downloads
      • Release Notes
      • API Reference
        • v1.0.0
          • NinetyEight.INEGdk
          • NinetyEight.ErrorCode
          • NinetyEight.NEGameProfile
          • NinetyEight.NEGameProfileCallback
          • NinetyEight.NEGameProfileResponse
          • NinetyEight.NEGdkConfig
          • NinetyEight.NEInitCallback
          • NinetyEight.NELoginCallback
          • NinetyEight.NELoginData
          • NinetyEight.NEProvider
          • NinetyEight.NEShopBuyCallback
          • NinetyEight.NEShopBuyResponse
          • NinetyEight.NEShopInfoCallback
          • NinetyEight.NEShopInfoResponse
          • NinetyEight.NEShopItem
          • NinetyEight.NEShopPack
          • NinetyEight.NEUserBalance
          • NinetyEight.NEUserBalanceCallback
          • NinetyEight.NEUserBalanceResponse
          • NinetyEight.NEUserPet
          • NinetyEight.NEUserPetCallback
          • NinetyEight.NEUserPetResponse
          • NinetyEight
    • Cocos Creator
      • Installation Guide
      • Update Guide
      • Examples
      • Downloads
      • Release Notes
      • API Reference
        • NinetyEight Game Development Kit - Cocos Creator
          • Enumerations
            • NinetyEight.NEEnvironment
            • NinetyEight.NEErrorCode
            • NinetyEight.NEProvider
          • Interfaces
          • Type-aliases
            • NEGameProfile
            • NEGameProfileCallback
            • NEGameProfileResponse
            • NEGdkConfig
            • NEInitCallback
            • NELoginCallback
            • NELoginData
            • NEShopBuyCallback
            • NEShopBuyResponse
            • NEShopInfoCallback
            • NEShopInfoResponse
            • NEShopItem
            • NEShopPack
            • NEUserBalance
            • NEUserBalanceCallback
            • NEUserBalanceResponse
            • NEUserPet
            • NEUserPetCallback
            • NEUserPetResponse
  • LEGAL
    • Game Terms of Use
    • Privacy Policy
    • Terms of Use
Powered by GitBook
On this page
  • Cocos Creator GDK Installation
  • Requirements
  • Before You Start
  • Import GDK to your project
  • Platform Setup
  1. GDK Documentation
  2. Cocos Creator

Installation Guide

Cocos Creator GDK Installation

Requirements

  • Node.js

  • Cocos Creator 3.8+

  • Minimum Android SDK version: 24

  • Minimum iOS version: 12.0

Before You Start

Before importing GDK into your project, please follow these instructions:

Android

  • Generate an Android build to create native/engine/android (skip if it already exists in your project).

  • Update minSdkVersion in native/engine/android/app/build.gradle to 24 (required by WalletCore).

iOS

  • Generate an iOS build to create native/engine/ios.

  • In the Build Panel, set OS Target to iPhoneOS and Target iOS Version to 12.0.

Import GDK to your project

Download the latest version here

Ensure that native/engine/android and native/engine/ios exist in your project.

You can import NEGdk using a script (requires Node.js) or manually.

Using Script

To import NEGdk into your project, run:

cd negdk
node ./scripts/import.js

You will be prompted to enter your project directory path.

Manual

If you want to import NEGdk manually into your project, follow these steps:

  • Copy negdk/assets/negdk into your project's <your_project>/assets folder.

  • Copy negdk/native into your project root folder.

  • Add dependencies from negdk/template/android/dependency.gradle to <your_project>/native/engine/android/app/build.gradle.

  • Append the contents of negdk/template/ios/CMakeLists.txt to <your_project>/native/engine/ios/CMakeLists.txt.

Platform Setup

Web Setup

  1. In Cocos Creator, select assets/negdk/plugins/web/negdk.js.

  2. In the Inspector, check Import As Plugin.

  3. Enable Load In Web, and disable Load In Native and Load In MiniGame.

  4. Click Save.

Android Setup

NEGDK uses Ramper to support social login on Android and iOS. Your app's scheme must be configured for this feature to work.

Configure Your App Scheme

Update your app's scheme in AndroidManifest.xml at <your_project>/native/engine/android/app/AndroidManifest.xml:

<activity android:name="com.cocos.game.AppActivity">
    <!-- Other configurations -->

    <intent-filter>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.DEFAULT"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <data android:scheme="your_app_scheme"/>
    </intent-filter>
</activity>

Forwarding Activity Intent Callback to NEGDK

Modify your main activity file (<your_project>/native/engine/android/app/src/com/cocos/game/AppActivity.java) to forward intents to GDK:

import com.ne.gdk.NEGdk;

public class AppActivity extends CocosActivity {
    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        SDKWrapper.shared().onNewIntent(intent);
        
        // Forward intent to GDK
        NEGdk.getInstance().onNewIntent(intent);
    }
}

iOS Setup

NEGDK uses Ramper for social login on iOS. Your app's scheme must be configured accordingly.

Configure Your App Scheme

Add the following CFBundleURLTypes block to Info.plist (<your_project>/native/engine/ios/Info.plist):

<dict>
    <!-- Other configurations -->
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>your_app_scheme</string>
            </array>
        </dict>
    </array>
</dict>

Forwarding Application openURL Callback to NEGDK

Modify AppDelegate.mm (native/engine/ios/AppDelegate.mm) to forward URL-based app openings to GDK:

#import <NEGdk/NEGdk.h>

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString *, id> *)options {
    [[NEGdk sharedInstance] application:app openURL:url options:options];
    return YES;
}
PreviousCocos CreatorNextUpdate Guide

Last updated 21 days ago