You can download it from here.
⚠️ Note: CocosCreator SDK must be used together with the Android or iOS SDK
Description of the downloaded package directory:
Folder | Description |
---|---|
Android | SDK package required for Android integration |
iOS | SDK package required for iOS integration |
Android_iOS | SDK package required for both Android & iOS |
Platform directory description:
Folder/File Name | Description |
---|---|
Script | TypeScript code files to be imported into the Cocos Creator project |
bridge/iOS | Bridge code files for Xcode project, to be added to your game's Xcode project |
bridge/Android | Bridge code files for Android Studio project, including source (source dir) and aar package (library dir); choose as needed for your game's Android project |
(1) In the SDK package, select the *_cocosjs_bridge.aar
under the Android platform and place it in the project's libs
directory, then import it via build.gradle
:
dependencies {
api fileTree(include: ['*.jar','*.aar'], dir: 'libs')
}
Alternatively, you can use the source code by placing it in the project's src/main/java
directory. In this case, you need to add the following ProGuard rules:
-keep public class com.**.cocosjs.**
-keepclassmembers class com.**.cocosjs.** {
public *;
}
(2) Please visit here for more details. For integration instructions, refer to here.
(1) Drag the iOSCocosCreatorBridge
folder into the file list on the left side of Xcode. In the pop-up dialog, make the following selections (as shown in the figure):
(2) Please visit here for more details. For integration instructions, refer to here.
import {ATSDK} from "db://assets/script/AnyThinkAds/ATSDK";
// ---------------GDPR Initialization Flow start------------------------------
/*ATSDK.getUserLocation(function (userLocation: string | number) {
if (userLocation === ATSDK.kATUserLocationInEU) {
if (ATSDK.getGDPRLevel() === ATSDK.UNKNOWN) {
ATSDK.showGDPRConsent(function () {
ATSDK.initSDK("your app id", "your app key");
});
}
}
});*/
// ---------------GDPR Initialization Flow end------------------------------
ATSDK.initSDK("your app id", "your app key");