// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. using System; using System.Collections.Generic; using Microsoft.AppCenter.Unity.Distribute.Internal; namespace Microsoft.AppCenter.Unity.Distribute { #if UNITY_IOS || UNITY_ANDROID using RawType = System.IntPtr; #else using RawType = System.Type; #endif public class Distribute { // Used by App Center Unity Editor Extensions: https://github.com/Microsoft/AppCenter-SDK-Unity-Extension public const string DistributeSDKVersion = "4.3.0"; public static void PrepareEventHandlers() { DistributeInternal.PrepareEventHandlers(); } public static void AddNativeType(List nativeTypes) { DistributeInternal.AddNativeType(nativeTypes); } public static AppCenterTask IsEnabledAsync() { return DistributeInternal.IsEnabledAsync(); } public static AppCenterTask SetEnabledAsync(bool enabled) { return DistributeInternal.SetEnabledAsync(enabled); } public static void CheckForUpdate() { DistributeInternal.CheckForUpdate(); } /// /// Change the base URL opened in the browser to get update token from user login information. /// /// Install base URL. public static void SetInstallUrl(string installUrl) { DistributeInternal.SetInstallUrl(installUrl); } /// /// Change the base URL used to make API calls. /// /// API base URL. public static void SetApiUrl(string apiUrl) { DistributeInternal.SetApiUrl(apiUrl); } /// /// Sets the release available callback. /// /// The release available callback. public static ReleaseAvailableCallback ReleaseAvailable { get; set; } /// /// Sets the app will exit callback. /// /// The app will exit callback. public static WillExitAppCallback WillExitApp { get; set; } /// /// Sets the no release available callback. /// /// The no release available callback. public static NoReleaseAvailableCallback NoReleaseAvailable { get; set; } public static void StartDistribute() { DistributeInternal.StartDistribute(); } /// /// If update dialog is customized by returning true in , /// You need to tell the distribute SDK using this function what is the user action. /// /// Update action. On mandatory update, you can only pass public static void NotifyUpdateAction(UpdateAction updateAction) { DistributeInternal.NotifyUpdateAction((int)updateAction); } } }