TopOn Cocos2dx version SDK is a re-encapsulated version based on the Android and iOS versions of TopOn. It is convenient for developers based on the Cocos2d environment to integrate and use. Supported advertising forms include rewarded video ads, interstitial ads, banners ads native ads.
| File | Description | Required |
|---|---|---|
| Classes/bridge | It includes the calling interface classes and callback interfaces that the SDK needs to use. For details, see Description below | Y |
| bridge_ios | Detailed implementation of the iOS version SDK conversion interface | Y |
| bridge_android/jni | Specific JNI implementation of the Android SDK conversion interface | Y |
| bridge_android/source | Android version Java implementation of SDK conversion interface | Y |
1. Cocos2dx SDK only provides C++ and bridge files, please download the iOS native SDK (iOS download) or Android native SDK (Android download);
1. Drag the files in the bridge directory in Classes into the Classes group of Xcode;
2 Copy bridge_ios to the project proj.ios_mac/ios directory, and drag the content into the ios group of Xcode;
Specific xcode environment For configuration and framework reference, Please refer to the iOS help document
1. Change the Configure the files in the bridge directory and bridge_android/jni to CMakeList.txt, so that the project can import the .cpp and .h files;
2. The java code in the bridge_android/source/com/anythink/cocos2dx/bridge directory (including the entire path directory) to the game's android project /app/src
Specific Android Studio environment configuration and AAR library reference, Please refer to the Android help documentation
It is strongly recommended to use the native API (Objective-C / Java) in Xcode/Android Studio to access. For more information on how to integrate open-screen ads using Objective-C / Java, please refer to the TopOn SDK integration documentation
| System platform | Description |
|---|---|
| TopOn Android SDK | View |
| TopOn iOS SDK | View |
Specific calling examples are as follows:
iOS:
[[ATAdManager sharedManager] loadADWithPlacementID:@"your ad placement id"
extra:@{kATSplashExtraTolerateTimeoutKey:@5.0} delegate:self window:window containerView:nil];The window in iOS can be displayed directly using the windonw in the AppController class
Android: You need to create an Activity in the application. For detailed demo, you can view: proj.android/app/src/org.cocos2dx.cpp/SplashActivity
new ATSplashAd(this, container, placementId, listener);