private static Application SetWrapperSdkAndGetApplication()
 {
     AndroidMobileCenter.SetWrapperSdk(new AndroidWrapperSdk {
         WrapperSdkName = WrapperSdk.Name, WrapperSdkVersion = WrapperSdk.Version
     });
     return((Application)Application.Context);
 }
        /// <summary>
        /// Initialize the SDK with the list of services to start.
        /// This may be called only once per application process lifetime.
        /// </summary>
        /// <param name="appSecret">A unique and secret key used to identify the application.</param>
        /// <param name="services">List of services to use.</param>
        public static void Start(string appSecret, params Type[] services)
        {
            string parsedSecret;

            try
            {
                parsedSecret = GetSecretForPlatform(appSecret, PlatformIdentifier);
            }
            catch (ArgumentException ex)
            {
                MobileCenterLog.Assert(MobileCenterLog.LogTag, ex.Message);
                return;
            }
            AndroidMobileCenter.Start(SetWrapperSdkAndGetApplication(), parsedSecret, GetServices(services));
        }
Beispiel #3
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;
                xamarinAndroidVersion = xamarinAndroidVersion?.Split(';')[0];
            }
            var wrapperSdk = new AndroidWrapperSdk
            {
                WrapperSdkName        = WrapperSdk.Name,
                WrapperSdkVersion     = WrapperSdk.Version,
                WrapperRuntimeVersion = xamarinAndroidVersion
            };

            AndroidMobileCenter.SetWrapperSdk(wrapperSdk);
            return((Application)Application.Context);
        }
 /// <summary>
 ///     Change the base URL (scheme + authority + port only) used to send logs.
 /// </summary>
 /// <param name="logUrl">base log URL.</param>
 public static void SetLogUrl(string logUrl)
 {
     AndroidMobileCenter.SetServerUrl(logUrl);
 }
 /// <summary>
 /// Start services.
 /// This may be called only once per service per application process lifetime.
 /// </summary>
 /// <param name="services">List of services to use.</param>
 public static void Start(params Type[] services)
 {
     AndroidMobileCenter.Start(GetServices(services));
 }
 /// <summary>
 /// Configure the SDK.
 /// This may be called only once per application process lifetime.
 /// </summary>
 /// <param name="appSecret">A unique and secret key used to identify the application.</param>
 public static void Configure(string appSecret)
 {
     AndroidMobileCenter.Configure(SetWrapperSdkAndGetApplication(), appSecret);
 }
 /// <summary>
 /// Initialize the SDK with the list of services to start.
 /// This may be called only once per application process lifetime.
 /// </summary>
 /// <param name="appSecret">A unique and secret key used to identify the application.</param>
 /// <param name="services">List of services to use.</param>
 public static void Start(string appSecret, params Type[] services)
 {
     AndroidMobileCenter.Start(SetWrapperSdkAndGetApplication(), appSecret, GetServices(services));
 }
Beispiel #8
0
 static void PlatformSetLogUrl(string logUrl)
 {
     AndroidMobileCenter.SetLogUrl(logUrl);
 }
Beispiel #9
0
 static void PlatformSetCustomProperties(CustomProperties customProperties)
 {
     AndroidMobileCenter.SetCustomProperties(customProperties.AndroidCustomProperties);
 }
Beispiel #10
0
        static Task PlatformSetEnabledAsync(bool enabled)
        {
            var future = AndroidMobileCenter.SetEnabled(enabled);

            return(Task.Run(() => future.Get()));
        }
Beispiel #11
0
        static Task <bool> PlatformIsEnabledAsync()
        {
            var future = AndroidMobileCenter.IsEnabled();

            return(Task.Run(() => (bool)future.Get()));
        }
Beispiel #12
0
 static void PlatformStart(params Type[] services)
 {
     AndroidMobileCenter.Start(GetServices(services));
 }