Exemplo n.º 1
0
        /// <summary>
        /// Grabs the singleton ad client for the specified network and performs
        /// necessary setup for it, including initializing it and subscribing to its events.
        /// </summary>
        /// <returns>The ad client.</returns>
        /// <param name="network">Network.</param>
        private static AdClientImpl SetupAdClient(AdNetwork network)
        {
            AdClientImpl client = GetAdClient(network);

            if (client != null && client.Network != AdNetwork.None)
            {
                // Subscribe client's events.
                SubscribeAdClientEvents(client);

                // Initialize ad client.
                if (!client.IsInitialized)
                {
                    client.Init();
                }
            }

            return(client);
        }