Esempio n. 1
0
        static Application SetWrapperSdkAndGetApplication()
        {
            var    monoAssembly                 = typeof(Java.Lang.Object).Assembly;
            var    monoAssemblyAttibutes        = monoAssembly.GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), true);
            var    monoAssemblyVersionAttibutes = monoAssemblyAttibutes as AssemblyInformationalVersionAttribute[];
            string xamarinAndroidVersion        = null;

            if (monoAssemblyVersionAttibutes?.Length > 0)
            {
                xamarinAndroidVersion = monoAssemblyVersionAttibutes[0].InformationalVersion;
                var indexOfVersion = xamarinAndroidVersion?.IndexOf(';') ?? -1;
                if (indexOfVersion >= 0)
                {
                    xamarinAndroidVersion = xamarinAndroidVersion?.Substring(0, indexOfVersion + 1);
                }
            }
            var wrapperSdk = new AndroidWrapperSdk
            {
                WrapperSdkName        = WrapperSdk.Name,
                WrapperSdkVersion     = WrapperSdk.Version,
                WrapperRuntimeVersion = xamarinAndroidVersion
            };

            AndroidAppCenter.SetWrapperSdk(wrapperSdk);
            return((Application)Application.Context);
        }
Esempio n. 2
0
        static void PlatformStart(string appSecret, params Type[] services)
        {
            string parsedSecret;

            try
            {
                parsedSecret = GetSecretAndTargetForPlatform(appSecret, PlatformIdentifier);
            }
            catch (AppCenterException ex)
            {
                AppCenterLog.Assert(AppCenterLog.LogTag, ex.Message);
                return;
            }
            AndroidAppCenter.Start(SetWrapperSdkAndGetApplication(), parsedSecret, GetServices(services));
        }
Esempio n. 3
0
 static void PlatformSetUserId(string userId)
 {
     AndroidAppCenter.SetUserId(userId);
 }
Esempio n. 4
0
 internal static void PlatformUnsetInstance()
 {
     AndroidAppCenter.UnsetInstance();
 }
Esempio n. 5
0
 static void PlatformSetCustomProperties(CustomProperties customProperties)
 {
     AndroidAppCenter.SetCustomProperties(customProperties.AndroidCustomProperties);
 }
Esempio n. 6
0
        static Task PlatformSetEnabledAsync(bool enabled)
        {
            var future = AndroidAppCenter.SetEnabled(enabled);

            return(Task.Run(() => future.Get()));
        }
Esempio n. 7
0
        static Task <bool> PlatformIsEnabledAsync()
        {
            var future = AndroidAppCenter.IsEnabled();

            return(Task.Run(() => (bool)future.Get()));
        }
Esempio n. 8
0
 static void PlatformStart(params Type[] services)
 {
     AndroidAppCenter.Start(GetServices(services));
 }
Esempio n. 9
0
 static void PlatformConfigure(string appSecret)
 {
     AndroidAppCenter.Configure(SetWrapperSdkAndGetApplication(), appSecret);
 }
Esempio n. 10
0
 static void PlatformSetLogUrl(string logUrl)
 {
     AndroidAppCenter.SetLogUrl(logUrl);
 }
Esempio n. 11
0
        static Task <bool> PlatformSetMaxStorageSizeAsync(long sizeInBytes)
        {
            var future = AndroidAppCenter.SetMaxStorageSize(sizeInBytes);

            return(Task.Run(() => (bool)future.Get()));
        }