Determine location using Microsoft Location Servic

2019-09-06 05:06发布

问题:

I submit my app on windows-phone7 store, Microsoft need following requirement to certify the app. The following requirements apply to applications that receive the location of a user's mobile device: 2.7.1 Your application must determine location using Microsoft Location Service API. 2.7.2 The privacy policy of your application must inform users about how location data from the Location Service API is used and disclosed and the controls that users have over the use and sharing of location data. This can be hosted within or directly linked from the application. Please help me what i want to mentioned or implement to certify the app.

回答1:

Here is the code I use to get the location.

            private static GeoCoordinateWatcher Watcher;            

            private void StartGeoWatcher()
            {

                if (Watcher == null)
                {
                    Watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.High);
                    Watcher.PositionChanged += new EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>>(OnPositionChanged);
                    Watcher.TryStart(false, System.TimeSpan.FromMilliseconds(1000));
                }

            }

            private void OnPositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
            {

                    latitude = e.Position.Location.Latitude;
                    longitude = e.Position.Location.Longitude;


            }