private static void NativeCustomTemplateDidReceiveClickCallback(
            IntPtr nativeCustomAd, string assetName)
        {
            CustomNativeTemplateClient client   = IntPtrToAdLoaderClient(nativeCustomAd);
            CustomNativeTemplateAd     nativeAd = new CustomNativeTemplateAd(client);

            client.clickHandler(nativeAd, assetName);
        }
Exemplo n.º 2
0
        private static void NativeCustomTemplateDidReceiveClickCallback(
            IntPtr nativeCustomAd, string assetName)
        {
            CustomNativeTemplateClient client = IntPtrToCustomTemplateAdClient(nativeCustomAd);

            if (client.clickHandler != null)
            {
                client.clickHandler(assetName);
            }
        }
        private static void NativeCustomTemplateDidReceiveClickCallback(
            IntPtr nativeCustomAd, string assetName)
        {
            CustomNativeTemplateClient client = IntPtrToAdLoaderClient(nativeCustomAd);

            if (client.clickHandler != null)
            {
                CustomNativeTemplateAd nativeAd = new CustomNativeTemplateAd(client);
                MobileAdsEventExecutor.executeInUpdate(() => client.clickHandler(nativeAd, assetName));
            }
        }
Exemplo n.º 4
0
        private static void AdLoaderDidReceiveNativeCustomTemplateAdCallback(
            IntPtr adLoader, IntPtr nativeCustomTemplateAd, string templateID)
        {
            AdLoaderClient             client   = IntPtrToAdLoaderClient(adLoader);
            CustomNativeTemplateClient adClient = new CustomNativeTemplateClient(
                nativeCustomTemplateAd);

            if (client.OnCustomNativeTemplateAdClicked != null &&
                client.TemplateIds[templateID] == true)
            {
                WeakReference weakClient = new WeakReference(adClient);
                adClient.clickHandler = delegate(string assetName)
                {
                    if (weakClient.IsAlive)
                    {
                        CustomNativeTemplateClient  strongClient = weakClient.Target as CustomNativeTemplateClient;
                        CustomNativeClientEventArgs args         = new CustomNativeClientEventArgs()
                        {
                            nativeAdClient = strongClient,
                            assetName      = assetName
                        };
                        client.OnCustomNativeTemplateAdClicked(client, args);
                    }
                };
            }

            if (client.OnCustomNativeTemplateAdLoaded != null)
            {
                CustomNativeClientEventArgs args = new CustomNativeClientEventArgs()
                {
                    nativeAdClient = adClient,
                    assetName      = null
                };
                client.OnCustomNativeTemplateAdLoaded(client, args);
            }
        }
Exemplo n.º 5
0
 internal static extern void GADUSetNativeCustomTemplateAdCallbacks(
         IntPtr nativeCustomTemplateAd,
         CustomNativeTemplateClient.GADUNativeCustomTemplateDidReceiveClick
             adClickedCallback);