示例#1
0
        public void Init(bool isOldUser, bool gdprSupported)
        {
            var settings = Resources.Load <ElephantSettings>("ElephantSettings");

            if (settings == null)
            {
                Debug.LogError(
                    "[Elephant SDK]  Elephant SDK settings isn't setup, use Window -> Elephant -> Edit Settings to enter your Game ID and Game Secret");
            }
            else
            {
                this.GameID     = settings.GameID;
                this.GameSecret = settings.GameSecret;
            }


            if (GameID.Equals(defaultGameID) || GameSecret.Equals(defaultGameSecret) || GameID.Trim().Length == 0 ||
                GameSecret.Trim().Length == 0)
            {
                Debug.LogError(
                    "[Elephant SDK]  Game ID and Game Secret are not present, make sure you replace them with yours using Window -> Elephant -> Edit Settings");
            }

            VersionCheckUtils.GetInstance();

            this.gdprSupported = gdprSupported;
            StartCoroutine(InitSDK(isOldUser));
        }
示例#2
0
        public void FillBaseData(long sessionID)
        {
            this.bundle         = Application.identifier;
            this.idfa           = ElephantCore.Instance.idfa;
            this.idfv           = ElephantCore.Instance.idfv;
            this.app_version    = Application.version;
            this.lang           = Utils.GetISOCODE(Application.systemLanguage);
            this.user_tag       = RemoteConfig.GetInstance().GetTag();
            this.os_version     = SystemInfo.operatingSystem;
            this.sdk_version    = ElephantVersion.SDK_VERSION;
            this.ad_sdk_version = VersionCheckUtils.GetInstance().AdSdkVersion;
            this.device_model   = SystemInfo.deviceModel;
            this.create_date    = Utils.Timestamp();
            this.session_id     = sessionID;

            try
            {
                TimeZone localZone     = TimeZone.CurrentTimeZone;
                DateTime currentDate   = DateTime.Now;
                TimeSpan currentOffset =
                    localZone.GetUtcOffset(currentDate);
                this.timezone_offset = currentOffset.ToString();
            }
            catch (Exception e)
            {
                Debug.Log(e);
            }
        }
示例#3
0
 public static VersionCheckUtils GetInstance()
 {
     return(_instance ?? (_instance = new VersionCheckUtils {
         AdSdkVersion = GetAdSdkVersion(),
         MopubVersion = GetMopubVersion(),
         UnityVersion = GetUnityVersion(),
         NetworkVersions = GetMopubNetworkVersions()
     }));
 }
示例#4
0
        private void SendVersionsEvent()
        {
            var versionCheckUtils = VersionCheckUtils.GetInstance();
            var versionData       = new VersionData(Application.version, ElephantVersion.SDK_VERSION,
                                                    SystemInfo.operatingSystem, versionCheckUtils.AdSdkVersion,
                                                    versionCheckUtils.MopubVersion, versionCheckUtils.UnityVersion,
                                                    versionCheckUtils.NetworkVersions);

            var parameters = Params.New()
                             .CustomString(JsonUtility.ToJson(versionData));

            Elephant.Event("elephant_sdk_versions_info", -1, parameters);
        }
示例#5
0
 public static VersionCheckUtils GetInstance()
 {
     return(_instance ?? (_instance = new VersionCheckUtils {
         AdSdkVersion = GetAdSdkVersion()
     }));
 }