Menu

Cocos SDK API Migration Guide


File Name Changes

Old File New File
ATJSSDK.ts ATSDK.ts
ATBannerTSSDK.ts ATBanner.ts
ATIntersitialTSSDK.ts ATInterstitial.ts
ATIntersitialAutoTSSDK.ts ATInterstitialAuto.ts
ATNativeTSSDK.ts ATNative.ts
ATRewardedVideoTSSDK.ts ATRewardedVideo.ts
ATRewardedAutoVideoTSSDK.ts ATRewardedAutoVideo.ts

ATSDK Migration

  • Import Changes
typescript Copy
// Old
import { ATJSSDK } from "./ATJSSDK";

// New
import { ATSDK } from "./ATSDK";
  • No changes in function names

ATBanner Migration

  • Import Changes
typescript Copy
// Old
import { ATBannerTSSDK } from "./ATBannerTSSDK";

// New
import { ATBannerSDK } from "./ATBanner";
  • Function Name Changes
Old Function (ATBannerTSSDK) New Function (ATBannerSDK) Description
loadBanner loadAd Function renamed
- showAdInPositionAndScenario New function
- showAdInRectangleAndScenario New function
All other functions remain unchanged

ATInterstitial Migration

  • Import Changes
typescript Copy
// Old
import { ATIntersitialTSSDK } from "./ATIntersitialTSSDK";

// New
import { ATInterstitialSDK } from "./ATInterstitial";
  • Function Name Changes
Old Function (ATIntersitialTSSDK) New Function (ATInterstitialSDK) Description
loadInterstitial loadAd Function renamed
- entryAdScenario New function
All other functions remain unchanged

ATInterstitialAuto Migration

  • Import Changes
typescript Copy
// Old
import { ATIntersitialAutoTSSDK } from "./ATIntersitialAutoTSSDK";

// New
import { ATInterstitialAutoAdSDK } from "./ATInterstitialAuto";
  • Function Name Changes
Old Function (ATIntersitialAutoTSSDK) New Function (ATInterstitialAutoAdSDK) Description
- entryAdScenario New function
All other functions remain unchanged

ATNative Migration

  • Import Changes
typescript Copy
// Old
import { ATNativeTSSDK } from "./ATNativeTSSDK";

// New
import { ATNativeSDK } from "./ATNative";
  • Function Name Changes
Old Function (ATNativeTSSDK) New Function (ATNativeSDK) Description
loadNative loadAd Function renamed
- entryAdScenario New function
All other functions remain unchanged
  • Class Changes

The AdViewProperty class remains unchanged, but should now be imported from ATNative:

typescript Copy
// Old
import { AdViewProperty } from "./ATNativeTSSDK";

// New
import { AdViewProperty } from "./ATNative";

ATRewardedVideo Migration

  • Import Changes
typescript Copy
// Old
import { ATRewardedVideoTSSDK } from "./ATRewardedVideoTSSDK";

// New
import { ATRewardedVideoSDK } from "./ATRewardedVideo";
  • Function Name Changes
Old Function (ATRewardedVideoTSSDK) New Function (ATRewardedVideoSDK) Description
loadRewardedVideo loadAd Function renamed
- entryAdScenario New function
All other functions remain unchanged

ATRewardedAutoVideo Migration

  • Import Changes
typescript Copy
// Old
import { ATRewardedAutoVideoTSSDK } from "./ATRewardedAutoVideoTSSDK";

// New
import { ATRewardedVideoAutoAdSDK } from "./ATRewardedAutoVideo";
  • Function Name Changes
Old Function (ATRewardedAutoVideoTSSDK) New Function (ATRewardedVideoAutoAdSDK) Description
- entryAdScenario New function
All other functions remain unchanged

📌 Migration Example Code
typescript Copy
// Initialize SDK
// Old
import { ATJSSDK } from "./ATJSSDK";
ATJSSDK.initSDK("appId", "appKey");
// New
import { ATSDK } from "./ATSDK";
ATSDK.initSDK("appId", "appKey");

// Load Banner Ad
// Old
import { ATBannerTSSDK } from "./ATBannerTSSDK";
ATBannerTSSDK.loadBanner("placementId", settings);
// New
import { ATBannerSDK } from "./ATBanner";
ATBannerSDK.loadAd("placementId", settings);

// Load Interstitial Ad
// Old
import { ATIntersitialTSSDK } from "./ATIntersitialTSSDK";
ATIntersitialTSSDK.loadInterstitial("placementId", settings);
// New
import { ATInterstitialSDK } from "./ATInterstitial";
ATInterstitialSDK.loadAd("placementId", settings);

// Load Native Ad
// Old
import { ATNativeTSSDK } from "./ATNativeTSSDK";
ATNativeTSSDK.loadNative("placementId", settings);
// New
import { ATNativeSDK } from "./ATNative";
ATNativeSDK.loadAd("placementId", settings);

// Load Rewarded Video Ad
// Old
import { ATRewardedVideoTSSDK } from "./ATRewardedVideoTSSDK";
ATRewardedVideoTSSDK.loadRewardedVideo("placementId", settings);
// New
import { ATRewardedVideoSDK } from "./ATRewardedVideo";
ATRewardedVideoSDK.loadAd("placementId", settings);

Summary

Main migration changes:

  1. File names are simplified, removing the "TSSDK" suffix
  2. Main loading functions are unified as loadAd
  3. Some modules add the new entryAdScenario function
  4. Access to classes and constants remains unchanged, but they should be imported from the new modules

Previous
Cocos Creator Guide
Next
Integration
Last modified: 2025-06-04Powered by