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); }
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)); }
static void PlatformSetUserId(string userId) { AndroidAppCenter.SetUserId(userId); }
internal static void PlatformUnsetInstance() { AndroidAppCenter.UnsetInstance(); }
static void PlatformSetCustomProperties(CustomProperties customProperties) { AndroidAppCenter.SetCustomProperties(customProperties.AndroidCustomProperties); }
static Task PlatformSetEnabledAsync(bool enabled) { var future = AndroidAppCenter.SetEnabled(enabled); return(Task.Run(() => future.Get())); }
static Task <bool> PlatformIsEnabledAsync() { var future = AndroidAppCenter.IsEnabled(); return(Task.Run(() => (bool)future.Get())); }
static void PlatformStart(params Type[] services) { AndroidAppCenter.Start(GetServices(services)); }
static void PlatformConfigure(string appSecret) { AndroidAppCenter.Configure(SetWrapperSdkAndGetApplication(), appSecret); }
static void PlatformSetLogUrl(string logUrl) { AndroidAppCenter.SetLogUrl(logUrl); }
static Task <bool> PlatformSetMaxStorageSizeAsync(long sizeInBytes) { var future = AndroidAppCenter.SetMaxStorageSize(sizeInBytes); return(Task.Run(() => (bool)future.Get())); }