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:

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:

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:

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):

Forwarding Application openURL Callback to NEGDK

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

Last updated