Beispiel #1
0
        private void RegisterAdapter(SDKConfig config, SDKAdapterConfig adapterConfig)
        {
            if (!adapterConfig.isEnable)
            {
                return;
            }

            Type type = Type.GetType(adapterConfig.adapterClassName);
            if (type == null)
            {
                Log.w("Not Support DataAnalysis:" + adapterConfig.adapterClassName);
                return;
            }
            IDataAnalysisAdapter adapter = type.Assembly.CreateInstance(adapterConfig.adapterClassName) as IDataAnalysisAdapter;

            if (adapter == null)
            {
                Log.e("DataAnalysis Adapter Create Failed:" + adapterConfig.adapterClassName);
                return;
            }

            if (adapter.InitWithConfig(config, adapterConfig))
            {
                m_Adapters.Add(adapter);

                Log.i("Success Register DataAnalysisAdapter:" + adapterConfig.adapterClassName);
            }
            else
            {
                Log.w("Failed Register DataAnalysisAdapter:" + adapterConfig.adapterClassName);
            }
        }
Beispiel #2
0
        public bool InitWithConfig(SDKConfig config, SDKAdapterConfig adapterConfig)
        {
            var             name            = AppsFlyerTrackerCallbacks.S.name;
            AppsflyerConfig appsflyerConfig = adapterConfig as AppsflyerConfig;

            AppsFlyer.setAppsFlyerKey(appsflyerConfig.appKey);
            if (appsflyerConfig.isDebugMode)
            {
                AppsFlyer.setIsDebug(true);
            }

#if UNITY_IOS
            /* Mandatory - set your apple app ID
             * NOTE: You should enter the number only and not the "ID" prefix */
            AppsFlyer.setAppID(config.iosAppID);
            AppsFlyer.trackAppLaunch();
#elif UNITY_ANDROID
            /* Mandatory - set your Android package name */
            AppsFlyer.setAppID(Application.identifier);
            /* For getting the conversion data in Android, you need to add the "AppsFlyerTrackerCallbacks" listener.*/
            //AppsFlyer.init(appsflyerConfig.appKey, "AppsFlyerTrackerCallbacks");
            AppsFlyer.init(appsflyerConfig.appKey);
            AppsFlyer.loadConversionData("AppsFlyerTrackerCallbacks");
#endif

            return(true);
        }
Beispiel #3
0
        protected override bool DoAdapterInit(SDKConfig config, SDKAdapterConfig adapterConfig)
        {
            if (Social.localUser == null)
            {
                return(false);
            }

            /*
             * if (!Social.localUser.authenticated)
             * {
             *  return true;
             * }
             */
            Social.localUser.Authenticate(OnAuthenticatedEvent);
            if (Social.localUser.authenticated)
            {
                m_GameCenterState = true;
            }

            /*
             #if UNITY_IPHONE
             * UnityEngine.iOS.NotificationServices.RegisterForNotifications(
             *  NotificationType.Alert |
             *  NotificationType.Badge |
             *  NotificationType.Sound);
             #endif
             */
            return(true);
        }
Beispiel #4
0
 //protected
 protected override bool DoAdapterInit(SDKConfig config, SDKAdapterConfig adapterConfig)
 {
     m_Config = adapterConfig as FacebookAdsConfig;
     if (m_Config.isDebugMode)
     {
         AdSettings.AddTestDevice("6275f42bceb568babc15c283a4b9de8b");
     }
     return(true);
 }
Beispiel #5
0
        protected override bool DoAdapterInit(SDKConfig config, SDKAdapterConfig adapterConfig)
        {
#if !UNITY_EDITOR
            AppLovin.InitializeSdk();
            //AppLovin.SetTestAdsEnabled(m_Config.isDebugMode);
            AppLovin.SetUnityAdListener("ApplovinEventCenter");
#endif
            return(true);
        }
Beispiel #6
0
        protected override bool DoAdapterInit(SDKConfig config, SDKAdapterConfig adapterConfig)
        {
            UmengConfig umengConfg = adapterConfig as UmengConfig;


#if UNITY_IOS
            GA.StartWithAppKeyAndChannelId(umengConfg.iosAppKey, umengConfg.appChannelId);
#else
            GA.StartWithAppKeyAndChannelId(umengConfg.androidAppKey, umengConfg.appChannelId);
#endif
            return(true);
        }
Beispiel #7
0
        protected override bool DoAdapterInit(SDKConfig config, SDKAdapterConfig adapterConfig)
        {
            //   AndroidJavaClass jc = new AndroidJavaClass("com.kids.adsdk.AdSdk");

            //AndroidJavaObject context = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity");

            //   AndroidJavaObject jo1 =  jc.CallStatic<AndroidJavaObject>("get",context);
            //   jo1.Call("init");

            //   jc = new AndroidJavaClass("com.kids.bcsdk.BcSdk");

            //jc.CallStatic("init", context);

            return(true);
        }
Beispiel #8
0
        protected override bool DoAdapterInit(SDKConfig config, SDKAdapterConfig adapterConfig)
        {
            m_Config = adapterConfig as PolyAdsConfig;

            if (!m_Config.isLibEnable)
            {
                return(false);
            }

            UPSDK.UPSDKInitFinishedCallback = OnSDKInitFinish;

            UPSDK.initPolyAdSDK(0);

            return(true);
        }
Beispiel #9
0
        protected override bool DoAdapterInit(SDKConfig config, SDKAdapterConfig adapterConfig)
        {
            //AudienceNetwork.AdSettings.AddTestDevice("6275f42bceb568babc15c283a4b9de8b");

            m_Config = adapterConfig as AdmobAdsConfig;

#if UNITY_ANDROID
            string appId = m_Config.appIDAndroid;
#elif UNITY_IPHONE
            string appId = m_Config.appIDIos;
#else
            string appId = "unexpected_platform";
#endif
            MobileAds.Initialize(appId);
            return(true);
        }
Beispiel #10
0
        protected override bool DoAdapterInit(SDKConfig config, SDKAdapterConfig adapterConfig)
        {
            string gameID = GetAdsGameID(config);

            if (string.IsNullOrEmpty(gameID))
            {
                Log.w("Invalid Unity Ads Config.");
                return(false);
            }
            if (Advertisement.isSupported)
            {
                Advertisement.Initialize(gameID);
                return(true);
            }
            return(false);
        }
Beispiel #11
0
        protected override bool DoAdapterInit(SDKConfig config, SDKAdapterConfig adapterConfig)
        {
            m_Config = adapterConfig as IronSourceAdsConfig;

            Log.i(IronSourceEvents.S.ToString());

            IronSource.Agent.init(m_Config.appKey, IronSourceAdUnits.REWARDED_VIDEO);
            IronSource.Agent.init(m_Config.appKey, IronSourceAdUnits.INTERSTITIAL);
            IronSource.Agent.init(m_Config.appKey, IronSourceAdUnits.BANNER);

            IronSource.Agent.init(m_Config.appKey);

            EventSystem.S.Register(EngineEventID.OnApplicationPauseChange, OnApplicationPauseChange);

            return(true);
        }
Beispiel #12
0
        private bool RegisterAdapter(SDKConfig sdkConfig, SDKAdapterConfig adapterConfig)
        {
            if (!adapterConfig.isEnable)
            {
                return(false);
            }

            Type type = Type.GetType(adapterConfig.adapterClassName);

            if (type == null)
            {
                Log.w("Not Support Ads:" + adapterConfig.adapterClassName);
                return(false);
            }

            var        method     = type.GetMethod("GetInstance", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
            IAdAdapter adsAdapter = null;

            if (method != null)
            {
                adsAdapter = method.Invoke(null, null) as IAdAdapter;
            }
            else
            {
                adsAdapter = type.Assembly.CreateInstance(adapterConfig.adapterClassName) as IAdAdapter;
            }

            if (adsAdapter == null)
            {
                Log.e("AdAdapter Create Failed:" + adapterConfig.adapterClassName);
                return(false);
            }

            if (adsAdapter.InitWithConfig(sdkConfig, adapterConfig))
            {
                m_AdAdapterMap.Add(adsAdapter.adPlatform, adsAdapter);

                Log.i("Success Register AdAdapter:" + adsAdapter.adPlatform);
            }
            else
            {
                Log.w("Failed Register AdAdapter:" + adsAdapter.adPlatform);
            }

            return(true);
        }
Beispiel #13
0
        public bool InitWithConfig(SDKConfig config, SDKAdapterConfig adapterConfig)
        {
            SDKMgr.S.RegisterFilebaseDepInitCB(() =>
            {
                FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);

                FirebaseAnalytics.SetUserProperty(
                    FirebaseAnalytics.UserPropertySignUpMethod,
                    "Unity");
                // Set the user ID.
                FirebaseAnalytics.SetUserId("my_user");
                // Set default session duration values.
                FirebaseAnalytics.SetMinimumSessionDuration(new TimeSpan(0, 0, 10));
                FirebaseAnalytics.SetSessionTimeoutDuration(new TimeSpan(0, 30, 0));
                m_Init = true;
            });
            return(true);
        }
Beispiel #14
0
        protected override bool DoAdapterInit(SDKConfig config, SDKAdapterConfig adapterConfig)
        {
            m_Config = adapterConfig as MoPubAdsConfig;
#if UNITY_ANDROID
            string appId = m_Config.appIDAndroid;
#elif UNITY_IPHONE
            string appId = m_Config.appIDIos;
#else
            string appId = "unexpected_platform";
#endif

            string adUnit = m_Config.anyAdUnit;

            MoPub.InitializeSdk(new MoPubBase.SdkConfiguration
            {
                AdUnitId        = adUnit,
                AdvancedBidders = new MoPub.AdvancedBidder[] {
                    MoPub.AdvancedBidder.AppLovin,
                    MoPub.AdvancedBidder.Unity,
                    MoPub.AdvancedBidder.AdMob,
                    MoPub.AdvancedBidder.Facebook
                },
                NetworksToInit = new MoPub.RewardedNetwork[] {
                    MoPub.RewardedNetwork.Unity,
                    MoPub.RewardedNetwork.Facebook,
                    MoPub.RewardedNetwork.AppLovin,
                    MoPub.RewardedNetwork.AdMob
                },
                MediationSettings = new MoPubBase.MediationSetting[] {
                }
            });

            MoPub.ReportApplicationOpen(appId);

            return(true);
        }
Beispiel #15
0
 public bool InitWithConfig(SDKConfig config, SDKAdapterConfig adapterConfig)
 {
     m_AdapterConfig = adapterConfig;
     return(DoAdapterInit(config, adapterConfig));
 }
Beispiel #16
0
 public bool InitWithConfig(SDKConfig config, SDKAdapterConfig adapterConfig)
 {
     throw new NotImplementedException();
 }
Beispiel #17
0
 public bool InitWithConfig(SDKConfig config, SDKAdapterConfig adapterConfig)
 {
     return(true);
 }
 protected override bool DoAdapterInit(SDKConfig config, SDKAdapterConfig adapterConfig)
 {
     return(true);
 }
Beispiel #19
0
 protected virtual bool DoAdapterInit(SDKConfig config, SDKAdapterConfig adapterConfig)
 {
     return(true);
 }