Exemplo n.º 1
0
 protected override void OnStart()
 {
     MobileCenter.Start(typeof(Analytics), typeof(Crashes));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Invoked when the application is launched normally by the end user.  Other entry points
 /// will be used such as when the application is launched to open a specific file.
 /// </summary>
 /// <param name="e">Details about the launch request and process.</param>
 protected override void OnLaunched(LaunchActivatedEventArgs e)
 {
     MobileCenter.Start("3ceb4858-3b7c-45f4-8883-0d99578c9ad8", typeof(Analytics));
     OnActivated(e);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            Push.PushNotificationReceived += (sender, es) => {
                // Add the notification message and title to the message
                var summary = $"Push notification received:" +
                              $"\n\tNotification title: {es.Title}" +
                              $"\n\tMessage: {es.Message}";

                // If there is custom data associated with the notification,
                // print the entries
                if (es.CustomData != null)
                {
                    summary += "\n\tCustom data:\n";
                    foreach (var key in es.CustomData.Keys)
                    {
                        summary += $"\t\t{key} : {es.CustomData[key]}\n";
                    }
                }

                // Send the notification summary to debug output
                System.Diagnostics.Debug.WriteLine(summary);
            };
            MobileCenter.LogLevel = LogLevel.Verbose;
            // TODO: 1.2 - Ensure we use ALL of the window space.  That means we have to make sure we follow the safe area of the screen!
            // ApplicationView.GetForCurrentView().SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow);

            // TODO: 5.1 - If we want a ten foot view, we probably want color safe colors as well.  This dictionary solves that for default styles.
            //if (App.IsTenFoot)
            //{
            //    // use TV colorsafe values
            //    this.Resources.MergedDictionaries.Add(new ResourceDictionary
            //    {
            //        Source = new Uri("ms-appx:///TvSafeColors.xaml")
            //    });
            //}
            //MobileCenter code
            //MobileCenter.SetLogUrl("https://in-staging-south-centralus.staging.avalanch.es");
            MobileCenter.SetCountryCode("China");
            MobileCenter.Start("84599058-77f7-4801-9e62-bdbb7bf7293d", typeof(Analytics), typeof(Crashes), typeof(Push));
            //Analytics.Enabled = true;

            var installid = MobileCenter.GetInstallIdAsync();

            System.Diagnostics.Debug.WriteLine("InstallId=" + installid.Result.ToString());
            Push.CheckLaunchedFromNotification(e);


            ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;

            if (titleBar != null)
            {
                Color titleBarColor = (Color)App.Current.Resources["SystemChromeMediumColor"];
                titleBar.BackgroundColor       = titleBarColor;
                titleBar.ButtonBackgroundColor = titleBarColor;
            }

            MainPage shell = Window.Current.Content as MainPage;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (shell == null)
            {
                // Create a AppShell to act as the navigation context and navigate to the first page
                shell = new MainPage();

                // Set the default language
                shell.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                shell.AppFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    // Should load state from previous run
                }
            }

            // Place our app shell in the current Window
            Window.Current.Content = shell;

            if (shell.AppFrame.Content == null)
            {
                // When the navigation stack isn't restored, navigate to the first page
                // suppressing the initial entrance animation.
                shell.AppFrame.Navigate(typeof(AllPresidentsView), e.Arguments, new Windows.UI.Xaml.Media.Animation.SuppressNavigationTransitionInfo());
            }

            // Ensure the current window is active
            Window.Current.Activate();

            ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(320, 200));
        }
Exemplo n.º 4
0
 protected override void OnStart()
 {
     MobileCenter.Start("60978d5a-dee0-43b8-885c-db7faf603da4", typeof(Distribute));
     // Handle when your app starts
 }
Exemplo n.º 5
0
 protected override void OnStart()
 {
     // Handle when your app starts
     MobileCenter.Start(typeof(Analytics), typeof(Crashes));
 }
Exemplo n.º 6
0
        /// <summary>
        /// 최종 사용자가 응용 프로그램을 정상적으로 시작할 때 호출됩니다. 다른 진입점은
        /// 특정 파일을 여는 등 응용 프로그램을 시작할 때
        /// </summary>
        /// <param name="e">시작 요청 및 프로세스에 대한 정보입니다.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            #region for Mobile Center
            // Get the user's geographic region and its two-letter identifier for this region.
            var geographicRegion = new Windows.Globalization.GeographicRegion();
            var code             = geographicRegion.CodeTwoLetter;

            //MobileCenter.LogLevel = LogLevel.Verbose;
            MobileCenter.SetCountryCode(code);
            MobileCenter.Start("e7c53299-f7ce-4aa2-85cd-082b383de045", typeof(Analytics), typeof(Crashes));
            #endregion

#if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                //this.DebugSettings.EnableFrameRateCounter = true;
            }
#endif

            Frame rootFrame = Window.Current.Content as Frame;

            // 창에 콘텐츠가 이미 있는 경우 앱 초기화를 반복하지 말고,
            // 창이 활성화되어 있는지 확인하십시오.
            if (rootFrame == null)
            {
                //MVVM 초기화
                GalaSoft.MvvmLight.Threading.DispatcherHelper.Initialize();
                FontHelper.FontDAO = SimpleIoc.Default.GetInstance <FontDAO>();

                // 탐색 컨텍스트로 사용할 프레임을 만들고 첫 페이지로 이동합니다.
                rootFrame = new Frame();

                rootFrame.NavigationFailed += OnNavigationFailed;

                if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                {
                    //TODO: 이전에 일시 중지된 응용 프로그램에서 상태를 로드합니다.
                }

                // 현재 창에 프레임 넣기
                Window.Current.Content = rootFrame;
            }

            if (e.PrelaunchActivated == false)
            {
                if (rootFrame.Content == null)
                {
                    //이전에 풀스크린으로 끝났었다면 강제로 종료시킴
                    if (IsMobile || UIViewSettings.GetForCurrentView().UserInteractionMode == UserInteractionMode.Touch)
                    {
                        var cv = ApplicationView.GetForCurrentView();
                        if (cv.IsFullScreenMode)
                        {
                            cv.ExitFullScreenMode();
                        }
                    }

                    // 탐색 스택이 복원되지 않으면 첫 번째 페이지로 돌아가고
                    // 필요한 정보를 탐색 매개 변수로 전달하여 새 페이지를
                    // 구성합니다.
                    rootFrame.Navigate(typeof(MainPage), e.Arguments);
                }
                // 현재 창이 활성 창인지 확인
                Window.Current.Activate();
            }
        }
Exemplo n.º 7
0
 public MobileCenterLogger(string key)
 {
     MobileCenter.Start($"uwp={key}", typeof(Analytics));
 }
Exemplo n.º 8
0
 public App()
 {
     InitializeComponent();
     MobileCenter.Start(typeof(Analytics), typeof(Crashes));
     MainPage = new CISampleApp.MainPage();
 }
Exemplo n.º 9
0
 public static async Task Start(string APIKey)
 {
     MobileCenter.Configure(APIKey);
     MobileCenter.Start(typeof(Analytics), typeof(Crashes));
     await Analytics.SetEnabledAsync(true);
 }
Exemplo n.º 10
0
 protected override void OnStart()
 {
     MobileCenter.Start("android=90fd90c9-2a8a-4b83-be9c-f988f54de29d;",
                        typeof(Analytics), typeof(Crashes));
 }
Exemplo n.º 11
0
 protected override void OnStart()
 {
     MobileCenter.Start("android=41320330-983d-4d55-8020-56fb7bf8c907;", typeof(Analytics), typeof(Crashes));
 }
Exemplo n.º 12
0
 private void mobileCenterEnabled_CheckedChanged(object sender, EventArgs e)
 {
     MobileCenter.SetEnabledAsync(mobileCenterEnabled.Checked).Wait();
 }
Exemplo n.º 13
0
 public override void OnCreate()
 {
     base.OnCreate();
     MobileCenter.Configure("0aaae641-48f0-4151-9bc5-def43896e5a9");
     global::Xamarin.Forms.Forms.Init(this, null);
 }
Exemplo n.º 14
0
 public App()
 {
     MobileCenter.Start(typeof(Analytics), typeof(Crashes));
     // The root page of your application
     MainPage = new NavigationPage(new MainPage());
 }
Exemplo n.º 15
0
 public MobileCenterLogger(string key)
 {
     MobileCenter.Start($"android={key}", typeof(Analytics), typeof(Crashes));
 }
Exemplo n.º 16
0
 public MobileCenterLogger(string key)
 {
     MobileCenter.Start($"ios={key}", typeof(Analytics), typeof(Crashes), typeof(Push));
 }
Exemplo n.º 17
0
 public Setup(Context applicationContext) : base(applicationContext)
 {
     MobileCenter.Start("5bad6674-51e9-4673-9507-a9fdad2e6a27", typeof(Analytics), typeof(Crashes));
     _dataService = new AndroidSpecificDataService(applicationContext);
 }
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // Override point for customization after application launch.
            // If not required for your application you can safely delete this method

                        #if ENABLE_TEST_CLOUD
            Xamarin.Calabash.Start();
                        #endif

            Forms.Init();

            SQLitePCL.Batteries.Init();

            //Dependency enject
            LoadApplication(new App());
            DependencyService.Register <IAppNavigation, AppNavigation>();


            //start mobile center
            //MobileCenter.LogLevel = Microsoft.Azure.Mobile.LogLevel.Verbose;
            MobileCenter.Start("a699460a-0d1a-4bf3-ad97-814103e5a097",
                               typeof(Analytics), typeof(Crashes));

            //Set up Notifications
            if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
            {
                var pushSettings = UIUserNotificationSettings.GetSettingsForTypes(
                    UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound,
                    new NSSet());

                UIApplication.SharedApplication.RegisterUserNotificationSettings(pushSettings);
                UIApplication.SharedApplication.RegisterForRemoteNotifications();
            }
            else
            {
                UIRemoteNotificationType notificationTypes = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound;
                UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(notificationTypes);
            }


            Setup.InitSvgLib();
            Config.ResourceAssembly = typeof(App).GetTypeInfo().Assembly;



            //Load Fonts  - todo pull out
            Iconize.With(new FontAwesomeModule())
            .With(new MaterialModule());

            //General apperance

            UINavigationBar.Appearance.TintColor = Color.White.ToUIColor();
            UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes {
                TextColor = UIColor.White
            });
            UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, false);



            //Set cache size
            var cache = new NSUrlCache(6 * 1024 * 1024, 200 * 1024 * 1024, "iosCache");             // Size in bytes
            NSUrlCache.SharedCache = cache;

            ApplicationDelegate.SharedInstance.FinishedLaunching(application, launchOptions);
            return(true);
        }
Exemplo n.º 19
0
 /// <summary>
 /// Initializes the singleton application object.  This is the first line of authored code
 /// executed, and as such is the logical equivalent of main() or WinMain().
 /// </summary>
 public App()
 {
     MobileCenter.Start(typeof(Analytics), typeof(Crashes));
     this.InitializeComponent();
     this.Suspending += OnSuspending;
 }
Exemplo n.º 20
0
        protected override void OnStart()
        {
            //xlarge screens are at least 960dp x 720dp
            //large screens are at least 640dp x 480dp
            //normal screens are at least 470dp x 320dp
            //small screens are at least 426dp x 320dp

            MobileCenter.Start("android=7d19d3ff-dec3-42f0-80d7-3d5b74bc3593;", typeof(Analytics), typeof(Crashes));

            float dens = DependencyService.Get <IDisplaySize>().GetDensity();
            int   wd   = DependencyService.Get <IDisplaySize>().GetWidthDiP();
            int   hd   = DependencyService.Get <IDisplaySize>().GetHeightDiP();

            int bigger, smaller;

            if (wd > hd) //landscape
            {
                bigger  = wd;
                smaller = hd;
            }
            else //portrait
            {
                bigger  = hd;
                smaller = wd;
            }

            if (smaller >= 700) //SW700 and above
            {
                StatusPage sp = new StatusPage();
                sp.Title = AppStrings.Status;
                MainTabs.Children.Add(sp);

                CountriesPage cap = new CountriesPage();
                cap.Title = AppStrings.Countries;
                MainTabs.Children.Add(cap);

                CitiesPage cip = new CitiesPage();
                cip.Title = AppStrings.Cities;
                MainTabs.Children.Add(cip);

                TorLogPage tlp = new TorLogPage();
                tlp.Title = AppStrings.TorLog;
                MainTabs.Children.Add(tlp);

                AboutPage ap = new AboutPage();
                ap.Title = AppStrings.About;
                MainTabs.Children.Add(ap);

                MainPage = new NavigationPage(MainTabs);
            }
            else
            {
                if (smaller >= 500 && smaller < 700) //SW500
                {
                    StatusPageSW500 sp = new StatusPageSW500();
                    sp.Title = AppStrings.Status;
                    MainTabs.Children.Add(sp);

                    CountriesPageSW500 cap = new CountriesPageSW500();
                    cap.Title = AppStrings.Countries;
                    MainTabs.Children.Add(cap);

                    TorLogPageSW500 tlp = new TorLogPageSW500();
                    tlp.Title = AppStrings.TorLog;
                    MainTabs.Children.Add(tlp);

                    AboutPageSW400 ap = new AboutPageSW400();
                    ap.Title = AppStrings.About;
                    MainTabs.Children.Add(ap);

                    MainPage = new NavigationPage(MainTabs);
                }
                else
                {
                    if (smaller >= 400) //SW400
                    {
                        if (wd > hd)
                        {
                            StatusPagePhoneL       = new StatusPageSW400();
                            StatusPagePhoneL.Title = AppStrings.Status;
                            //Application.Current.MainPage.Navigation.PopAsync();
                            MainTabs.Children.Add(StatusPagePhoneL);
                            MainPage = new NavigationPage(MainTabs);
                            StatusPagePhoneL.DisplayPosition = DisplayPos.Landscape;
                        }
                        else
                        {
                            StatusPagePhoneP       = new StatusPageSW400p();
                            StatusPagePhoneP.Title = AppStrings.Status;
                            MainTabs.Children.Add(StatusPagePhoneP);
                            MainPage = new NavigationPage(MainTabs);
                            StatusPagePhoneP.DisplayPosition = DisplayPos.Portrait;
                        }

                        TorLogPageSW400 tlp = new TorLogPageSW400();
                        tlp.Title = AppStrings.TorLog;
                        MainTabs.Children.Add(tlp);

                        CountriesPageSW400 cap = new CountriesPageSW400();
                        cap.Title = AppStrings.Countries;
                        MainTabs.Children.Add(cap);

                        AboutPageSW400 ap = new AboutPageSW400();
                        ap.Title = AppStrings.About;
                        MainTabs.Children.Add(ap);
                    }
                    else//SW300
                    {
                        if (wd > hd)
                        {
                            StatusPagePhoneL       = new StatusPageSW300();
                            StatusPagePhoneL.Title = AppStrings.Status;
                            MainTabs.Children.Add(StatusPagePhoneL);
                            MainPage = new NavigationPage(MainTabs);
                            StatusPagePhoneL.DisplayPosition = DisplayPos.Landscape;
                        }
                        else
                        {
                            StatusPagePhoneP       = new StatusPageSW300p();
                            StatusPagePhoneP.Title = AppStrings.Status;
                            MainTabs.Children.Add(StatusPagePhoneP);

                            MainPage = new NavigationPage(MainTabs);
                            StatusPagePhoneP.DisplayPosition = DisplayPos.Portrait;
                        }

                        TorLogPageSW300 tlp = new TorLogPageSW300();
                        tlp.Title = AppStrings.TorLog;
                        MainTabs.Children.Add(tlp);

                        CountriesPageSW300 cap = new CountriesPageSW300();
                        cap.Title = AppStrings.Countries;
                        MainTabs.Children.Add(cap);

                        AboutPageSW300 ap = new AboutPageSW300();
                        ap.Title = AppStrings.About;
                        MainTabs.Children.Add(ap);
                    }
                }
            }
        }
Exemplo n.º 21
0
 protected override void OnStart()
 {
     MobileCenter.Start($"android={Common.MobileCenterConstants.AndroidAppId};" +
                        $"ios={Common.MobileCenterConstants.iOSAppId}",
                        typeof(Analytics), typeof(Crashes));
 }
 private void UpdateState()
 {
     mobileCenterEnabled.IsChecked = MobileCenter.IsEnabledAsync().Result;
     analyticsEnabled.IsChecked    = Analytics.IsEnabledAsync().Result;
 }
Exemplo n.º 23
0
 static void Start(string appSecret) =>
 MobileCenter.Start(appSecret, typeof(Analytics), typeof(Crashes), typeof(Distribute));
Exemplo n.º 24
0
        /// <inheritdoc />
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Handler to create jobs.
            handler = new Handler(msg => {
                switch (msg.What)
                {
                case MESSAGE_SERVICE_CLEAR_PAYMENTS:
                    clearPaymentsJob = (ClearPaymentsJob)msg.Obj;
                    clearPaymentsJob.ScheduleTask();
                    break;

                case MESSAGE_SERVICE_RECURRING_PAYMENTS:
                    recurringPaymentJob = (RecurringPaymentJob)msg.Obj;
                    recurringPaymentJob.ScheduleTask();
                    break;
                }
            });

            SetContentView(Resource.Layout.activity_main);

#if !DEBUG
            MobileCenter.Start("6d9840ff-d832-4c1b-a2ee-bac7f15d89bd",
                               typeof(Analytics), typeof(Crashes));
#endif

            DrawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            MainFrame    = FindViewById <CoordinatorLayout>(Resource.Id.main_frame);

            if (bundle == null)
            {
                await ViewModel.ShowMenuAndFirstDetail();
            }

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
            if (toolbar != null)
            {
                SetSupportActionBar(toolbar);
                SupportActionBar.SetDisplayHomeAsUpEnabled(true);

                var drawerToggle = new MvxActionBarDrawerToggle(
                    this,                        // host Activity
                    DrawerLayout,                // DrawerLayout object
                    toolbar,                     // nav drawer icon to replace 'Up' caret
                    Resource.String.drawer_open, // "open drawer" description
                    Resource.String.drawer_close // "close drawer" description
                    );

                DrawerLayout.AddDrawerListener(drawerToggle);
                drawerToggle.SyncState();
            }

            // Start services and provide it a way to communicate with us.
            var startServiceIntentClearPayment = new Intent(this, typeof(ClearPaymentsJob));
            startServiceIntentClearPayment.PutExtra("messenger", new Messenger(handler));
            StartService(startServiceIntentClearPayment);

            var startServiceIntentRecurringPayment = new Intent(this, typeof(RecurringPaymentJob));
            startServiceIntentRecurringPayment.PutExtra("messenger", new Messenger(handler));
            StartService(startServiceIntentRecurringPayment);

            Mvx.Resolve <IBackgroundTaskManager>().StartBackupSyncTask(Mvx.Resolve <ISettingsManager>().BackupSyncRecurrence);
        }
Exemplo n.º 25
0
 protected override void OnStart()
 {
     MobileCenter.Start("android=18619034-ca31-4a1d-9d1a-8f67a76e4d36;ios=fee95673-3c6f-490f-b9ed-e0300f4f46e9;", typeof(Analytics), typeof(Crashes));
 }
Exemplo n.º 26
0
 protected override void OnStart()
 {
     MobileCenter.Start($"ios={AppSettings.AppCenterAnalyticsIos};uwp={AppSettings.AppCenterAnalyticsWindows};android={AppSettings.AppCenterAnalyticsAndroid}", typeof(Analytics), typeof(Crashes));
 }