Example #1
0
        // Creates a NativeExpressAd with a custom position.
        public NativeExpressAdView(string adUnitId, AdSize adSize, int x, int y)
        {
            Type googleMobileAdsClientFactory = Type.GetType(
                "GoogleMobileAds.GoogleMobileAdsClientFactory,Assembly-CSharp");
            MethodInfo method = googleMobileAdsClientFactory.GetMethod(
                "BuildNativeExpressAdClient",
                BindingFlags.Static | BindingFlags.Public);

            client = (INativeExpressAdClient)method.Invoke(null, null);
            client.CreateNativeExpressAdView(adUnitId, adSize, x, y);

            ConfigureNativeExpressAdEvents();
        }