Exemplo 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);
        }
Exemplo 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));
        }
Exemplo n.º 3
0
 static void PlatformSetUserId(string userId)
 {
     AndroidAppCenter.SetUserId(userId);
 }
Exemplo n.º 4
0
 internal static void PlatformUnsetInstance()
 {
     AndroidAppCenter.UnsetInstance();
 }
Exemplo n.º 5
0
 static void PlatformSetCustomProperties(CustomProperties customProperties)
 {
     AndroidAppCenter.SetCustomProperties(customProperties.AndroidCustomProperties);
 }
Exemplo n.º 6
0
        static Task PlatformSetEnabledAsync(bool enabled)
        {
            var future = AndroidAppCenter.SetEnabled(enabled);

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

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

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