| | |
| | | using Microsoft.AppCenter; |
| | | using Microsoft.AppCenter.Analytics; |
| | | using Microsoft.AppCenter.Crashes; |
| | | using HDL_ON.UI; |
| | | |
| | | namespace SharedMethod |
| | | { |
| | |
| | | NSUserDefaults.StandardUserDefaults.SetString(DeviceToken, "PushDeviceToken"); |
| | | string userPhoneName = UIDevice.CurrentDevice.Name; |
| | | |
| | | UserConfig.Instance.PushDeviceToken = DeviceToken; |
| | | OnAppConfig.Instance.PushDeviceToken = DeviceToken; |
| | | //UserConfig.Instance.phoneName = userPhoneName; |
| | | //UserConfig.Instance.SaveUserConfig(); |
| | | } |
| | | if (UserConfig.Instance.PushDeviceToken != DeviceToken) |
| | | if (OnAppConfig.Instance.PushDeviceToken != DeviceToken) |
| | | { |
| | | string userPhoneName = UIDevice.CurrentDevice.Name; |
| | | UserConfig.Instance.PushDeviceToken = DeviceToken; |
| | | OnAppConfig.Instance.PushDeviceToken = DeviceToken; |
| | | //UserConfig.Instance.phoneName = userPhoneName; |
| | | //UserConfig.Instance.SaveUserConfig(); |
| | | } |
| | |
| | | public override void DidEnterBackground(UIApplication application) |
| | | { |
| | | SharedMethod.SharedMethod.IsBackground = true; |
| | | HDL_ON.Entity.DB_ResidenceData.residenceData.SaveResidenceData(); |
| | | Console.WriteLine("DidEnterBackground"); |
| | | } |
| | | |
| | |
| | | { |
| | | SharedMethod.SharedMethod.IsBackground = false; |
| | | BusSocket.Start(6000); |
| | | AppUnlockPage.LoadPage(); |
| | | Console.WriteLine("WillEnterForeground"); |
| | | UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0; |
| | | } |
| | |
| | | { |
| | | Console.WriteLine("OnActivated"); |
| | | base.OnActivated(application); |
| | | |
| | | } |
| | | |
| | | public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) |
| | |
| | | application.StatusBarStyle = UIStatusBarStyle.DarkContent; |
| | | |
| | | string nsCount = NSLocale.CurrentLocale.CountryCode; |
| | | if (nsCount != UserConfig.Instance.CountryCode) |
| | | if (nsCount != OnAppConfig.Instance.CountryCode) |
| | | { |
| | | UserConfig.Instance.CountryCode = nsCount; |
| | | UserConfig.Instance.SaveUserConfig(); |
| | | OnAppConfig.Instance.CountryCode = nsCount; |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | } |
| | | application.IdleTimerDisabled = true; |
| | | application.RegisterForRemoteNotificationTypes(UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound); |
| | | |
| | | |
| | | Window = new UIWindow(UIScreen.MainScreen.Bounds); |
| | | var Root = new UINavigationController(new ViewController()) { NavigationBarHidden = true }; |
| | | Window.RootViewController = Root; |