protected override bool AdapterInit(SDKAdapterConfig adapterConfig)
    {
        AdjustAdapterConfig config = (AdjustAdapterConfig)adapterConfig;

        AdjustConfig adjustConfig = new AdjustConfig(config.m_AppToken, config.m_AdjustEnvironment);

        adjustConfig.setLogLevel(config.m_AdjustLogLevel);
        adjustConfig.setLogDelegate(msg => Log.I(msg));
        adjustConfig.setEventBufferingEnabled(config.m_EventBuffering);
        adjustConfig.setSendInBackground(config.m_SendInBackground);

        // adjustConfig.setDeferredDeeplinkDelegate(DeferredDeeplinkCallback);  //深度链接
        // adjustConfig.setEventSuccessDelegate(EventSuccessCallback);
        // adjustConfig.setEventFailureDelegate(EventFailureCallback);
        // adjustConfig.setSessionSuccessDelegate(SessionSuccessCallback);
        // adjustConfig.setSessionFailureDelegate(SessionFailureCallback);
        // adjustConfig.setAttributionChangedDelegate(AttributionChangedCallback);
        Adjust.start(adjustConfig);
        InitSuccess = true;

        m_AdjustDefine = new AdjustDefine();
        m_AdjustDefine.Init();

        Log.I("AdjustAnalysisAdapter init success");
        return(true);
    }
    protected override bool AdapterInit(SDKAdapterConfig adapterConfig)
    {
        m_AdapterConfig = adapterConfig as FacebookConfig;
        if (!FB.IsInitialized)
        {
            // Initialize the Facebook SDK
            FB.Init(InitCallback, OnHideUnity);
        }
        else
        {
            // Already initialized, signal an app activation App Event
            FB.ActivateApp();
            Log.I("FacebookAnalysisAdapter init success");
            InitSuccess = true;
        }

        return(true);
    }
    protected override bool AdapterInit(SDKAdapterConfig adapterConfig)
    {
        //Android 版 Firebase Unity SDK 需要使用 Google Play 服务。您必须先将 Google Play 服务更新为最新版本,然后才能使用该 SDK。
        Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
        {
            var dependencyStatus = task.Result;
            if (dependencyStatus == Firebase.DependencyStatus.Available)
            {
                // Create and hold a reference to your FirebaseApp,
                // where app is a Firebase.FirebaseApp property of your application class.
                //   app = Firebase.FirebaseApp.DefaultInstance;

                // Set a flag here to indicate whether Firebase is ready to use by your app.

                FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);
                //firebase初始化成功后调用FirebaseRemote
                //FirebaseRemoteMgr.Instance.Init();

                //FirebaseAnalytics.SetUserId("my_user");
                // Set default session duration values.
                //FirebaseAnalytics.SetMinimumSessionDuration(new TimeSpan(0, 0, 10));
                //FirebaseAnalytics.SetSessionTimeoutDuration(new TimeSpan(0, 30, 0));
                //FirebaseAnalytics.SetUserId(userid_af);
                // FirebaseAnalytics.SetUserProperty("userID", "");
                if (m_AdapterConfig.isDebugMode)
                {
                    Log.I("FirebaseAnalysisAdapter init success");
                }

                InitSuccess = true;
            }
            else
            {
                Log.E(System.String.Format(
                          "Could not resolve all Firebase dependencies: {0}", dependencyStatus));
                // Firebase Unity SDK is not safe to use here.
                InitSuccess = false;
            }
        });

        return(true);
    }
Exemple #4
0
    protected override bool AdapterInit(SDKAdapterConfig adapterConfig)
    {
        m_Config = adapterConfig as MopubAdsConfig;
        //mopubSDK初始化
#if UNITY_ANDROID
        string appId = m_Config.androidAppID;
#elif UNITY_IPHONE
        string appId = m_Config.iosAppID;
#else
        string appId = "unexpected_platform";
#endif
        // MoPub.ReportApplicationOpen(appId);

        //绑定日记等级
        MoPub.LogLevel logLevel = MoPub.LogLevel.None;
        if (m_Config.isDebugMode)
        {
            logLevel = MoPub.LogLevel.Debug;
        }

        //绑定初始化回调
        MoPubManager.OnSdkInitializedEvent += OnSdkInitializedEvent;
        MoPub.InitializeSdk(new MoPub.SdkConfiguration
        {
            //设置任意一个有效的广告id
            AdUnitId = m_Config.anyAdUnit,
            LogLevel = logLevel,

            //启动数据收集标记
            //AllowLegitimateInterest = true,

            //初始化广告网络示例
            //Note that keys must be strings, and values must be JSON-serializable (strings only, for MoPubRequestOptions).
            MediatedNetworks = new MoPubBase.MediatedNetwork[]
            {
                new MoPub.SupportedNetwork.Facebook {
                },
                new MoPub.SupportedNetwork.Unity {
                },

                new MoPub.SupportedNetwork.AdMob
                {
                    // Network adapter configuration settings (initialization).
                    // NetworkConfiguration = new Dictionary<string,string> {
                    //     { "app_id", "ca-app-pub-9726677720163576~9749987692" },
                    // },
                    // Global mediation settings (per ad request).
                    MediationSettings = new Dictionary <string, object> {
                        { "npa", 1 },
                    },
                    // Additional options to pass to the MoPub servers (per ad request).
                    // MoPubRequestOptions = new Dictionary<string,string> {
                    //     { "key1", "1" },
                    //     { "key2", "1" },
                    // }
                }
            }
        });


        return(true);
    }