private void CheckConfig(UnityEditor.BuildTarget platform) { Debug.Log("TTPPreProcessSettings::CheckConfig: "); string configurationJson = ((TTPCore.ITTPCoreInternal)TTPCore.Impl).GetConfigurationJson("global"); if (!string.IsNullOrEmpty(configurationJson)) { Debug.Log("TTPPreProcessSettings::CheckConfig: configurationJson=" + configurationJson); Dictionary <string, object> configuration = TTPJson.Deserialize(configurationJson) as Dictionary <string, object>; object storeObj; if (configuration.TryGetValue("store", out storeObj)) { string store = (string)storeObj; Debug.Log("TTPPreProcessSettings::CheckConfig: store=" + store); if (platform == UnityEditor.BuildTarget.iOS && !store.Equals("apple")) { Debug.LogError("Store in global.json does not match current platform:store=" + store + " platform=iOS"); } else if (platform == UnityEditor.BuildTarget.Android && !store.Equals("google")) { Debug.LogError("Store in global.json does not match current platform:store=" + store + " platform=Android"); } } } }
public void OnDDNALogEventCalled(string message) { if (message != null) { var dict = TTPJson.Deserialize(message) as Dictionary <string, object>; if (dict != null) { string eventName = null; IDictionary <string, object> eventParams = null; if (dict.ContainsKey("eventName")) { eventName = dict["eventName"] as string; } if (dict.ContainsKey("eventParams")) { eventParams = dict["eventParams"] as Dictionary <string, object>; } if (eventName != null && OnDDNALogEvent != null) { OnDDNALogEvent.Invoke(eventName, eventParams); } } } }
static Dictionary <string, object> OverrideCurrentConfig() { if (_overrideConfig == null) { var jsonStr = Impl.GetCurrentConfig(); if (!string.IsNullOrEmpty(jsonStr)) { _overrideConfig = TTPJson.Deserialize(jsonStr) as Dictionary <string, object>; } } return(_overrideConfig); }
public static Dictionary <string, object> GetAdditionalParams() { if (Impl != null) { var str = Impl.GetAdditionalParams(); if (str != null) { return(TTPJson.Deserialize(str) as Dictionary <string, object>); } } return(null); }
public void onRequestValueDictionaryComplete(string messageDictionaryStr) { Debug.Log("TTPAnalytics::AnalyticsDelegate::OnRequestValueResponse: " + messageDictionaryStr); if (messageDictionaryStr != null) { Dictionary <string, object> dictionary = TTPJson.Deserialize(messageDictionaryStr) as Dictionary <string, object>; if (_onRequestValueDictionaryResponseAction != null && dictionary != null) { _onRequestValueDictionaryResponseAction.Invoke(dictionary); _onRequestValueDictionaryResponseAction = null; } } }
private static void DownloadConfiguration(string domain) { string store = "google"; if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.iOS) { store = "apple"; } string url = domain + CORE_URL_ADDITION + store + "/" + PlayerSettings.applicationIdentifier; bool result = TTPMenu.DownloadConfiguration(url, CORE_JSON_FN); if (!result) { Debug.LogWarning("CoreConfigurationDownloader:: DownloadConfiguration: failed to download global configuration."); } #if UNITY_ANDROID string strictModeConfigUrl = domain + "/" + STRICT_MODE_JSON_FN + "/" + store + "/" + PlayerSettings.applicationIdentifier; bool strictModeResult = TTPMenu.DownloadConfiguration(strictModeConfigUrl, STRICT_MODE_JSON_FN); if (!strictModeResult) { Debug.LogWarning("CoreConfigurationDownloader:: DownloadConfiguration: failed to download configuration for strict mode android"); } #endif var additionalConfigUrl = domain + "/" + ADDITIONAL_CONFIG_JSON_FN + "/" + store + "/" + PlayerSettings.applicationIdentifier; var additionalConfigResult = TTPMenu.DownloadConfiguration(additionalConfigUrl, ADDITIONAL_CONFIG_JSON_FN); if (!additionalConfigResult) { Debug.LogWarning("CoreConfigurationDownloader:: DownloadConfiguration: failed to download additional configuration"); } #if UNITY_IOS else { var json = File.ReadAllText(CONFIGURATIONS_PATH + "/" + CORE_JSON_FN + ".json"); if (json != null) { var dict = TTPJson.Deserialize(json) as Dictionary <string, object>; if (dict != null) { var conversionModelType = "A"; if (dict.ContainsKey("conversionModelType")) { conversionModelType = dict["conversionModelType"] as string; } var conversionRulesUrl = "http://promo-images.ttpsdk.info/conversionJS/" + conversionModelType + "/conversion.js"; TTPEditorUtils.DownloadStringToFile(conversionRulesUrl, "Assets/StreamingAssets/ttp/conversion/conversion.js"); } } } #endif }