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
innative/engine/android/app/build.gradle
to24
(required by WalletCore).
iOS
Generate an iOS build to create
native/engine/ios
.In the Build Panel, set
OS Target
toiPhoneOS
andTarget iOS Version
to12.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
In Cocos Creator, select
assets/negdk/plugins/web/negdk.js
.In the
Inspector
, checkImport As Plugin
.Enable
Load In Web
, and disableLoad In Native
andLoad In MiniGame
.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