コード例 #1
0
 public static void LoadNativeAdvertForAdType(TDNativeAdType nativeType)
 {
                 #if UNITY_IPHONE
     _LoadNativeAdvertForAdType(nativeType.ToString());
                 #elif UNITY_ANDROID
     CallAndroidStaticMethod("LoadNativeAd", nativeType.ToString());
                 #endif
 }
コード例 #2
0
 public static void LoadNativeAdvertForTag(string tag, TDNativeAdType nativeType)
 {
                 #if UNITY_IPHONE
     _LoadNativeAdvertForPlacementTag(tag, nativeType.ToString());
                 #elif UNITY_ANDROID
     CallAndroidStaticMethod("LoadNativeAd", nativeType.ToString(), tag);
                 #endif
 }
コード例 #3
0
        public static TDNativeAd GetNativeAd(TDNativeAdType adType, string tag)
        {
            var nativeAdJson = "{}";

                        #if UNITY_IPHONE
            nativeAdJson = Marshal.PtrToStringAnsi(_GetNativeAdWithTag(tag, adType.ToString()));
                        #elif UNITY_ANDROID
            nativeAdJson = GetAndroidStatic <string>("GetNativeAdWithTag", adType.ToString(), tag);
                        #else
            return(null);
                        #endif

            return(TDNativeAd.CreateNativeAd(nativeAdJson));
        }
コード例 #4
0
        public static TDAdType GetAdTypeFromNativeType(TDNativeAdType nativeType)
        {
            var nativeString = nativeType.ToString();

            var typeString = nativeString.Replace("TDNativeAdType", "TDAdType");

            return(GetEnumFromString <TDAdType>(typeString));
        }
コード例 #5
0
        public static bool IsNativeAdReady(TDNativeAdType adType, string tag)
        {
            bool ready = false;

                        #if UNITY_ANDROID
            ready = GetAndroidStatic <bool>("IsNativeAdReady", adType.ToString(), tag);
                        #endif
            return(ready);
        }