コード例 #1
0
        public AdLoaderClient(AdLoader unityAdLoader)
        {
            IntPtr adLoaderClientPtr = (IntPtr)GCHandle.Alloc(this);

            this.customNativeTemplateCallbacks = unityAdLoader.CustomNativeTemplateClickHandlers;
            string[] templateIdsArray = new string[unityAdLoader.TemplateIds.Count];
            unityAdLoader.TemplateIds.CopyTo(templateIdsArray);

            NativeAdTypes adTypes = new NativeAdTypes();
            if (unityAdLoader.AdTypes.Contains(NativeAdType.CustomTemplate))
            {
                adTypes.CustomTemplateAd = true;
            }

            this.AdLoaderPtr = Externs.GADUCreateAdLoader(
                adLoaderClientPtr,
                unityAdLoader.AdUnitId,
                templateIdsArray,
                templateIdsArray.Length,
                ref adTypes);

            Externs.GADUSetAdLoaderCallbacks(
                this.AdLoaderPtr,
                AdLoaderDidReceiveNativeCustomTemplateAdCallback,
                AdLoaderDidFailToReceiveAdWithErrorCallback);
        }
コード例 #2
0
 internal static extern IntPtr GADUCreateAdLoader(
     IntPtr adLoader,
     string adUnitId,
     string[] templateIds,
     int templateIdsCount,
     ref NativeAdTypes types,
     bool returnUrlsForImageAssets);
コード例 #3
0
ファイル: AdLoaderClient.cs プロジェクト: howelllucas/Project
        public AdLoaderClient(AdLoader unityAdLoader)
        {
            this.adLoaderClientPtr = (IntPtr)GCHandle.Alloc(this);

            this.customNativeTemplateCallbacks = unityAdLoader.CustomNativeTemplateClickHandlers;
            string[] templateIdsArray = new string[unityAdLoader.TemplateIds.Count];
            unityAdLoader.TemplateIds.CopyTo(templateIdsArray);

            this.adTypes = new NativeAdTypes();
            if (unityAdLoader.AdTypes.Contains(NativeAdType.CustomTemplate))
            {
                adTypes.CustomTemplateAd = 1;
            }

            this.AdLoaderPtr = Externs.GADUCreateAdLoader(
                this.adLoaderClientPtr,
                unityAdLoader.AdUnitId,
                templateIdsArray,
                templateIdsArray.Length,
                ref adTypes);

            Externs.GADUSetAdLoaderCallbacks(
                this.AdLoaderPtr,
                AdLoaderDidReceiveNativeCustomTemplateAdCallback,
                AdLoaderDidFailToReceiveAdWithErrorCallback);
        }
コード例 #4
0
        public AdLoaderClient(AdLoaderClientArgs clientArgs)
        {
            this.adLoaderClientPtr = (IntPtr)GCHandle.Alloc(this);
            this.TemplateIds       = clientArgs.TemplateIds;
            string[] templateIdsArray = new string[TemplateIds.Keys.Count];
            TemplateIds.Keys.ToList().CopyTo(templateIdsArray);

            this.adTypes = new NativeAdTypes();
            bool configureReturnUrlsForImageAssets = false;

            if (clientArgs.AdTypes.Contains(NativeAdType.CustomTemplate))
            {
                configureReturnUrlsForImageAssets = false;
                adTypes.CustomTemplateAd          = 1;
            }
            this.AdLoaderPtr = Externs.GADUCreateAdLoader(
                this.adLoaderClientPtr,
                clientArgs.AdUnitId,
                templateIdsArray,
                templateIdsArray.Length,
                ref adTypes,
                configureReturnUrlsForImageAssets);

            Externs.GADUSetAdLoaderCallbacks(
                this.AdLoaderPtr,
                AdLoaderDidReceiveNativeCustomTemplateAdCallback,
                AdLoaderDidFailToReceiveAdWithErrorCallback);
        }
コード例 #5
0
 internal static extern IntPtr GADUCreateAdLoader(
     IntPtr adLoader, string adUnitId, string[] templateIds, int templateIdsCount,
     ref NativeAdTypes types);
コード例 #6
0
 internal static extern IntPtr GADUCreateAdLoader(
     IntPtr adLoader, string adUnitId, string[] templateIds, int templateIdsCount,
     ref NativeAdTypes types);