/// <summary>
        /// Get the unique installation identifier for this application installation on this device.
        /// </summary>
        /// <remarks>
        /// The identifier is lost if clearing application data or uninstalling application.
        /// </remarks>
        public static AppCenterTask <Guid?> GetInstallIdAsync()
        {
            var stringTask = AppCenterInternal.GetInstallIdAsync();
            var guidTask   = new AppCenterTask <Guid?>();

            stringTask.ContinueWith(t =>
            {
                var installId = !string.IsNullOrEmpty(t.Result) ? new Guid(t.Result) : (Guid?)null;
                guidTask.SetResult(installId);
            });
            return(guidTask);
        }
Ejemplo n.º 2
0
 public static void StartCrashes()
 {
     AppCenterInternal.Start(AppCenter.Crashes);
 }
Ejemplo n.º 3
0
    private void StartAppCenter()
    {
        if (Settings == null)
        {
            Debug.LogError("App Center isn't configured!");
            return;
        }
        var services = Settings.Services;

        PrepareEventHandlers(services);
        InvokeInitializingServices();
        AppCenter.SetWrapperSdk();
        AppCenter.CacheStorageSize(Settings.MaxStorageSize.Size);
        if (Settings.CustomLogUrl.UseCustomUrl)
        {
            AppCenter.CacheLogUrl(Settings.CustomLogUrl.Url);
        }
        var appSecret        = AppCenter.ParseAndSaveSecretForPlatform(Settings.AppSecret);
        var advancedSettings = GetComponent <AppCenterBehaviorAdvanced>();

        if (IsStartFromAppCenterBehavior(advancedSettings))
        {
            AppCenter.LogLevel = Settings.InitialLogLevel;
            if (Settings.CustomLogUrl.UseCustomUrl)
            {
                AppCenter.SetLogUrl(Settings.CustomLogUrl.Url);
            }
            if (Settings.MaxStorageSize.UseCustomMaxStorageSize && Settings.MaxStorageSize.Size > 0)
            {
                AppCenterInternal.SetMaxStorageSize(Settings.MaxStorageSize.Size);
            }
            var startupType = GetStartupType(advancedSettings);
            if (startupType != StartupType.Skip)
            {
                var transmissionTargetToken = GetTransmissionTargetToken(advancedSettings);
                var appSecretString         = GetAppSecretString(appSecret, transmissionTargetToken, startupType);
                if (string.IsNullOrEmpty(appSecretString))
                {
                    AppCenterInternal.Start(services);
                }
                else
                {
                    AppCenterInternal.Start(appSecretString, services);
                }
            }
        }
#if UNITY_IOS || UNITY_ANDROID
        else
        {
            foreach (var service in services)
            {
#if UNITY_IOS || UNITY_ANDROID
                // On iOS and Android we start crash service here, to give app an opportunity to assign handlers after crash and restart in Awake method
                var startCrashes = service.GetMethod("StartCrashes");
                if (startCrashes != null)
                {
                    startCrashes.Invoke(null, null);
                }
#endif
            }
        }
#endif
        InvokeInitializedServices();
        if (Started != null)
        {
            Started.Invoke();
        }
    }
 /// <summary>
 /// Change the base URL (scheme + authority + port only) used to communicate with the backend.
 /// </summary>
 /// <param name="logUrl">Base URL to use for server communication.</param>
 public static void SetLogUrl(string logUrl)
 {
     AppCenterInternal.SetLogUrl(logUrl);
 }
 public static string GetSdkVersion()
 {
     return(AppCenterInternal.GetSdkVersion());
 }
 public static void StartFromLibrary(Type[] servicesArray)
 {
     AppCenterInternal.StartFromLibrary(AppCenterInternal.ServicesToNativeTypes(servicesArray));
 }
 public static AppCenterTask <bool> IsEnabledAsync()
 {
     return(AppCenterInternal.IsEnabledAsync());
 }
 public static AppCenterTask SetEnabledAsync(bool enabled)
 {
     return(AppCenterInternal.SetEnabledAsync(enabled));
 }
 public static void SetUserId(string userId)
 {
     AppCenterInternal.SetUserId(userId);
 }
 public static void SetWrapperSdk()
 {
     AppCenterInternal.SetWrapperSdk(WrapperSdk.WrapperSdkVersion, WrapperSdk.Name, WrapperSdk.WrapperRuntimeVersion, null, null, null);
 }
        /// <summary>
        /// Set the custom properties.
        /// </summary>
        /// <param name="customProperties">Custom properties object.</param>
        public static void SetCustomProperties(Unity.CustomProperties customProperties)
        {
            var rawCustomProperties = customProperties.GetRawObject();

            AppCenterInternal.SetCustomProperties(rawCustomProperties);
        }
 public static void StartDistribute()
 {
     AppCenterInternal.Start(AppCenter.Distribute);
 }