Initialize SDK - uc-union/union-ads-sdk-demo GitHub Wiki

Initialization

Union Ad SDK MUST be initialzed correctly, or it may cause error ad request is processed.

Use UnionAdsSdk.start() in onCreate() of Application to activate and initialize Ad SDK.

Example codes are listed below, for a complete example please refer to UnionAdsSdkSampleApp.java

public class MyApplication extends Application {
    @Override
    public void onCreate() {
        ...
        UnionAdsSdk.start(this, <AppKey>);
    }
}

Note:

  1. If Application is not defined by the app, you need to derive one and define it in AndroidManifest.xml, please refer to AndroidManifest.xml
  1. <AppKey> is the unique id of your application in uc union system, you can see it in uc union manage console HERE

[Screen Shot]:

appkey-example

Next Steps

  • Follow our guide on Banners to add banner ads in your app.

  • Follow our guide on Interstitial to add interstitial ads in your app.

  • Follow our guide on Native Ads to add native ads in your app.

  • See FAQ to know about the frequently asked questions.

  • See API reference to explore all APIs in Union Ad SDK.

⚠️ **GitHub.com Fallback** ⚠️