public void SetCustomProperties()
        {
            var settingsMock = new Mock <IApplicationSettings>();

            settingsMock.Setup(settings => settings.GetValue(MobileCenter.EnabledKey, true)).Returns(true);
            var channelGroupMock = new Mock <IChannelGroup>();
            var channelUnitMock  = new Mock <IChannelUnit>();

            channelGroupMock.Setup(
                group => group.AddChannel(It.IsAny <string>(), It.IsAny <int>(), It.IsAny <TimeSpan>(), It.IsAny <int>()))
            .Returns(channelUnitMock.Object);
            MobileCenter.Instance = new MobileCenter(settingsMock.Object, new MockChannelGroupFactory(channelGroupMock));
            MobileCenter.Configure("appsecret");

            /* Set null. */
            MobileCenter.SetCustomProperties(null);
            channelUnitMock.Verify(channel => channel.Enqueue(It.IsAny <Log>()), Times.Never());

            /* Set empty. */
            var empty = new CustomProperties();

            MobileCenter.SetCustomProperties(empty);
            channelUnitMock.Verify(channel => channel.Enqueue(It.IsAny <Log>()), Times.Never());

            /* Set normal. */
            var properties = new CustomProperties();

            properties.Set("test", "test");
            MobileCenter.SetCustomProperties(properties);
            channelUnitMock.Verify(channel => channel.Enqueue(It.Is <CustomPropertiesLog>(log =>
                                                                                          log.Properties == properties.Properties)), Times.Once());
        }
Beispiel #2
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            new SfChartRenderer(); // This is necessary for initializing SyncFusion charts.

            #if DEBUG
            Xamarin.Calabash.Start();
            ObjCRuntime.Dlfcn.dlopen("recorderPluginCalabash.dylib", 0);
            #endif

            // Azure Mobile Services initilization
            Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init();

            // SQLite initialization
            SQLitePCL.CurrentPlatform.Init();

            // Xamarin.Forms initialization
            Forms.Init();

            // Xamarin.Forms.Maps initialization
            Xamarin.FormsMaps.Init();

            ImageCircleRenderer.Init();

            MobileCenter.Configure("f8e26157-b25d-4c15-9f04-89903a89c026");

            // Bootstrap the "core" Xamarin.Forms app
            LoadApplication(new App());

            // Apply OS-specific color theming
            ConfigureApplicationTheming();

            return(base.FinishedLaunching(app, options));
        }
        public void SetCustomProperties()
        {
            _settingsMock.Setup(settings => settings.GetValue(MobileCenter.EnabledKey, true)).Returns(true);
            var channelUnitMock = new Mock <IChannelUnit>();

            _channelGroupMock.Setup(
                group => group.AddChannel(It.IsAny <string>(), It.IsAny <int>(), It.IsAny <TimeSpan>(), It.IsAny <int>()))
            .Returns(channelUnitMock.Object);

            // Set before Mobile Center is configured.
            MobileCenter.SetCustomProperties(new CustomProperties());
            channelUnitMock.Verify(channel => channel.EnqueueAsync(It.IsAny <Log>()), Times.Never());

            MobileCenter.Configure("appsecret");

            // Set null.
            MobileCenter.SetCustomProperties(null);
            channelUnitMock.Verify(channel => channel.EnqueueAsync(It.IsAny <Log>()), Times.Never());

            // Set empty.
            var empty = new CustomProperties();

            MobileCenter.SetCustomProperties(empty);
            channelUnitMock.Verify(channel => channel.EnqueueAsync(It.IsAny <Log>()), Times.Never());

            // Set normal.
            var properties = new CustomProperties();

            properties.Set("test", "test");
            MobileCenter.SetCustomProperties(properties);
            channelUnitMock.Verify(channel => channel.EnqueueAsync(It.Is <CustomPropertiesLog>(log =>
                                                                                               log.Properties == properties.Properties)), Times.Once());
        }
 public void StartInstanceTwiceTogether()
 {
     MobileCenter.Configure("appsecret");
     MobileCenter.Start(typeof(MockMobileCenterService), typeof(MockMobileCenterService));
     MockMobileCenterService.Instance.MockInstance.Verify(
         service => service.OnChannelGroupReady(It.IsAny <ChannelGroup>(), It.IsAny <string>()), Times.Once());
 }
Beispiel #5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            global::Xamarin.Forms.Forms.Init(this, bundle);

            App.Init(new DbSQLite(new SQLite_Android().GetConnection()));

            ImageCircleRenderer.Init();

            DependencyService.Register <ToastNotificatorImplementation>(); // Register your dependency
            ToastNotificatorImplementation.Init(this);                     //TOAST NOTIFICATION
            PullToRefreshLayoutRenderer.Init();


            //Insights.DisableCollection = true;
            //Insights.DisableCollection = Settings.StatisticData;
            //Insights.Initialize("37a1497d790f720508e527850ad82785c117c774", Xamarin.Forms.Forms.Context);

            FormsAppCompatActivity.ToolbarResource   = Resource.Layout.toolbar;
            FormsAppCompatActivity.TabLayoutResource = Resource.Layout.tabs;


            //Set up Mobile Center https://mobile.azure.com/users/lorenzogiudici5/apps/unibgorari
            MobileCenter.Configure("99e6b366-7e20-46e7-97e9-43f3ec720529");
            LoadApplication(new App()); // method is new in 1.3


//			if ((int)Android.OS.Build.VERSION.SdkInt >= 21)
//			{
//				ActionBar.SetIcon ( new ColorDrawable (Resources.GetColor (Android.Resource.Color.Transparent)));
//			}
        }
Beispiel #6
0
        public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
        {
            //#if ENABLE_TEST_CLOUD
            Xamarin.Calabash.Start();
            //#endif


            CurrentPlatform.Init();
            SQLitePCL.CurrentPlatform.Init();
            Forms.Init();
            ImageCircleRenderer.Init();
            XFGloss.iOS.Library.Init();

            MobileCenter.Configure(Keys.MobileCenterKeyiOS);
            LoadApplication(new App());


            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;
            UIBarButtonItem.Appearance.SetBackButtonTitlePositionAdjustment(new UIOffset(0, -100), UIBarMetrics.Default);

            AppDomain.CurrentDomain.UnhandledException += (sender, e) => {
                try
                {
                    var exception = ((Exception)e.ExceptionObject).GetBaseException();
                    Console.WriteLine("**SPORT UNHANDLED EXCEPTION**\n\n" + exception);
                    exception.Track();
                }
                catch
                {
                    throw;
                }
            };

            return(base.FinishedLaunching(uiApplication, launchOptions));
        }
        public void ConfigureMobileCenterWithEmptyAppSecretEmptyResult()
        {
            var secrets = $"{MobileCenter.PlatformIdentifier}=";

            MobileCenter.Configure(secrets);

            Assert.IsFalse(MobileCenter.Configured);
        }
Beispiel #8
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            LoadApplication(new App());
            MobileCenter.Configure("eab192d2-06e0-4ea5-a9f4-f468e54766f8");

            return(base.FinishedLaunching(app, options));
        }
Beispiel #9
0
        protected override void OnCreate(Bundle bundle)
        {
            MobileCenter.Configure("e53f9276-4c1b-43a5-9f1c-f2888602721d");
            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new App());
        }
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            MobileCenter.Configure("44d9a3a1-8406-4243-8182-7695c7208f8d");
            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            LoadApplication(new App());

            MobileCenter.Configure("bf580b35-7828-4d85-a007-b4eef19a52e4");
            return(base.FinishedLaunching(app, options));
        }
        public void SetLogLevelBeforeConfigure()
        {
            MobileCenterLog.Level = LogLevel.Info;
            MobileCenter.LogLevel = LogLevel.Assert;
            MobileCenter.Configure("appsecret");

            Assert.AreEqual(LogLevel.Assert, MobileCenter.LogLevel);
        }
Beispiel #13
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            MobileCenter.Configure("4444398b-307e-4c28-8693-669d1ade242c");
            LoadApplication(new AzureBlobStorage.App());
        }
Beispiel #14
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            MobileCenter.Configure("0aaae641-48f0-4151-9bc5-def43896e5a9");

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(MakeSureApp());
        }
Beispiel #15
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            MobileCenter.Configure("73067325-b4e0-458c-8436-6ba40308ed6e");
            //MobileCenter.Start("BookingClientiOSAppSecret", typeof(Analytics), typeof(Crashes));
            global::Xamarin.Forms.Forms.Init();
            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
Beispiel #16
0
        // This is the main entry point of the application.
        static void Main(string[] args)
        {
            MobileCenter.Configure(AnalyticsConstants.MOBILE_CENTER_iOS_API_KEY);
            AnalyticsHelpers.Start();

            // if you want to use a different Application Delegate class from "AppDelegate"
            // you can specify it here.
            UIApplication.Main(args, null, "AppDelegate");
        }
        public void SetLogUrlAfterConfigure()
        {
            MobileCenter.Configure("appsecret");
            var customLogUrl = "www dot log url dot com";

            MobileCenter.SetLogUrl(customLogUrl);

            _channelGroupMock.Verify(channelGroup => channelGroup.SetLogUrl(customLogUrl), Times.Once());
        }
Beispiel #18
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            MobileCenter.Configure("215be87a-c5d8-4fd5-a458-6611858e015d");
            MobileAds.Initialize(ApplicationContext, "ca-app-pub-4355768148547933~6046156805");
            LoadApplication(new AdvertTest.App());
        }
        public void VerifyPlatformId()
        {
            CoreApplication.MainView.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
            {
                MobileCenter.Configure("uwp=appsecret");
            }).AsTask().GetAwaiter().GetResult();

            Assert.IsTrue(MobileCenter.Configured);
        }
        public void LogUrlIsNotSetByDefault()
        {
            var channelGroupMock = new Mock <IChannelGroup>();

            MobileCenter.Instance = new MobileCenter(new ApplicationSettings(),
                                                     new MockChannelGroupFactory(channelGroupMock));
            MobileCenter.Configure("appsecret");
            channelGroupMock.Verify(channelGroup => channelGroup.SetLogUrl(It.IsAny <string>()), Times.Never());
        }
        public void GetConfigured()
        {
            var isConfiguredFirst = MobileCenter.Configured;

            MobileCenter.Configure("some string");

            Assert.IsFalse(isConfiguredFirst);
            Assert.IsTrue(MobileCenter.Configured);
        }
Beispiel #22
0
        // This is the main entry point of the application.
        static void Main(string[] args)
        {
            // if you want to use a different Application Delegate class from "AppDelegate"
            // you can specify it here.
            MobileCenter.Configure("baed21b7-dfb1-4af5-90ef-1d4af7793678");
            AnalyticsHelpers.Start();

            UIApplication.Main(args, null, "AppDelegate");
        }
Beispiel #23
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();

            MobileCenter.Configure("8d7a5dc1-b25e-4587-97d7-82636a60667b");

            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
Beispiel #24
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            MobileCenter.Configure("your-ios-app-id");
            Microsoft.WindowsAzure.MobileServices.CurrentPlatform.Init();

            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();

            MobileCenter.Configure("2b3f11b1-6a90-4f28-9ae3-fc33b3c5d729");

            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();

            MobileCenter.Configure("44cd8722-bfe0-4748-ac14-7692e031a8a5");

            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();

            MobileCenter.Configure("a5a9d34f-ee95-4456-b09e-41fa302c21eb");

            LoadApplication(new App());

            return(base.FinishedLaunching(app, options));
        }
Beispiel #28
0
        public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
        {
            Xamarin.Forms.Forms.Init();

            MobileCenter.Configure("fe2bf05d-f4f9-48a6-83d9-ea8033fbb644");

            LoadApplication(new App());

            return(base.FinishedLaunching(uiApplication, launchOptions));
        }
Beispiel #29
0
        public static void SafeInit()
        {
            if (!MobileCenter.Configured)
            {
                MobileCenter.Configure("b19a97d0-8336-48cb-8e95-6269359dcf44");
            }

            MobileCenter.Enabled = true;
            Analytics.Enabled    = true;
        }
Beispiel #30
0
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            MobileCenter.Configure("<<YOUR KEY HERE>>");
            LoadApplication(new App());
        }