Appstock for Unity
  • Documentation
  • API Reference
Search Results for

    Show / Hide Table of Contents
    • Overview
    • Package Contents
    • Installation
    • Requirements and limitations
      • Requirements
      • Unity 2021/2022 Android issues
      • iOS blocks insecure requests
      • iOS Simulator on arm64
    • Displaying Ads
      • SDK Initialization
      • Banner Ad
      • Interstitial Ad
      • Rewarded Ad
      • Native Ads
        • Introduction to Native Ads
        • Building Native Ad Request
        • Applying Native Ad Response
    • Advanced Configuration
      • SDK Configuration
      • Improving targeting
      • Ext Slot
    • Samples

    SDK Initialization

    Tip

    Do this once, before attempting to load any ads.

    Call InitializeSdk and pass your partner key.

    You might find it useful to wrap this call in a dedicated MonoBehaviour to be invoked from Start -- (see Order of execution for event functions) -- once attached to some object on the scene.

    "Banner" sample provides such a demo:

    using System;
    using AppstockSDK.Api;
    using UnityEngine;
    
    namespace AppstockSDK.Demo.Banner
    {
        public class SdkInitializer : MonoBehaviour
        {
            // Start is called before the first frame update
            private void Start()
            {
                Debug.Log($"[{DateTime.Now:O}] Attempting to init SDK...");
                Appstock.InitializeSdk("appstock-demo");
            }
        }
    }
    
    In this article
    Back to top Generated by DocFX