wxr
2020-06-16 f6fd8acd7c53c44187e70b4709443318a628f4b5
Shared.IOS/BaseApplicationDelegate.cs
@@ -21,11 +21,15 @@
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            registerForRemoteNotification(application);
            //var musicInfo = new MusicInfo { };
            //Volume.Init();
            if (Shared.Application.IsMusicEnable)
            {
                var musicInfo = new MusicInfo { };
                Volume.Init();
            }
            FinishedLaunchingAction?.Invoke(application, launchOptions);
         /*
            //GPS
            if (Shared.Application.IsGpsEnable)
            {
@@ -53,7 +57,7 @@
                    ///TODO 可以提示用户打开定位权限
                }
            }
            */
            return true;
        }
@@ -77,7 +81,7 @@
                application.RegisterForRemoteNotificationTypes(UIRemoteNotificationType.NewsstandContentAvailability | UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound);
            }
        }
        /*
        class MyCLLocationManager : CLLocationManager
        {
            public static MyCLLocationManager Instance
@@ -121,18 +125,18 @@
                    {
                        var location = e.Locations[e.Locations.Length - 1];
                        //adjustDistanceFilter(location);
                        //System.Console.WriteLine($"位置信息变化 经度{location.Coordinate.Longitude}  纬度{location.Coordinate.Latitude}");
                        //Shared.HDLUtils.WriteLine($"位置信息变化 经度{location.Coordinate.Longitude}  纬度{location.Coordinate.Latitude}");
                        uploadToServer(location);
                    };
                }
            }
    //*  规则: 如果速度小于minSpeed m/s 则把触发范围设定为100m
    //*  否则将触发范围设定为minSpeed*minInteval
    //*  此时若速度变化超过10% 则更新当前的触发范围(这里限制是因为不能不停的设置distanceFilter,
    //*  否则uploadLocation会不停被触发)
            /**
    *  规则: 如果速度小于minSpeed m/s 则把触发范围设定为100m
    *  否则将触发范围设定为minSpeed*minInteval
    *  此时若速度变化超过10% 则更新当前的触发范围(这里限制是因为不能不停的设置distanceFilter,
    *  否则uploadLocation会不停被触发)
*/
            void adjustDistanceFilter(CLLocation location)
            {
                //    NSLog(@"adjust:%f",location.speed);
@@ -200,7 +204,7 @@
                }
            }
        }
    */
        public override void OnResignActivation(UIApplication application) => OnResignActivationAction?.Invoke(application);// Invoked when the application is about to move from active to inactive state.// This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) // or when the user quits the application and it begins the transition to the background state.// Games should use this method to pause the game.
        public override void DidEnterBackground(UIApplication application) => DidEnterBackgroundAction?.Invoke(application);// Use this method to release shared resources, save user data, invalidate timers and store the application state.// If your application supports background exection this method is called instead of WillTerminate when the user quits.