2013-09-25 5 views
1

스토어에 앱을 제출할 때 내 코드 벨로우트가 항상 오류가 발생하는 이유를 알고 있습니다. 모든 것이 디바이스에서 잘 돌아 간다. 응용 프로그램 기능 : 위치,지도, IDENTITY_DEVICE, IDENTITY_USER, 카메라, AUDIO, PHOTO, 네트워킹, 근접, PUSH_NOTIFICATION, 센서Geolocator Windows Phone의 오류

private readonly Geolocator _geolocator = new Geolocator { DesiredAccuracy = PositionAccuracy.Default, MovementThreshold = 100 }; 

private async Task GetCurrentPosition() 
    { 
     //Get current location 
     try 
     { 
      _done.WaitOne(); 
      var position = await _geolocator.GetGeopositionAsync(); 
      if (position != null) 
      { 
       // Get detail address 
       var query = new ReverseGeocodeQuery { GeoCoordinate = new GeoCoordinate(position.Coordinate.Latitude, position.Coordinate.Longitude) }; 
       query.QueryCompleted += OnQueryCompleted; 
       _done.Reset(); 
       query.QueryAsync(); 
      } 
     } 
     catch (Exception ex) 
     { 
      if (ex.Message.Contains("Operation aborted")) 
      { 
       if (MessageBox.Show(AppResources.LocationServiceErrorMsg, AppResources.ApplicationTitle, MessageBoxButton.OKCancel) == MessageBoxResult.OK) 
       { 
        Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-location:")); 
        Application.Current.Terminate(); 
       } 
       else 
       { 
        Application.Current.Terminate(); 
       } 
      } 
     } 
    } 

private void OnQueryCompleted(object sender, QueryCompletedEventArgs<System.Collections.Generic.IList<MapLocation>> e) 
    { 
     _done.Set(); 
     if (e.Result != null && e.Result.Count > 0) 
     { 
      App.AppData.CurrentCountry = e.Result[0].Information.Address.Country; 
      App.AppData.CurrentCity = e.Result[0].Information.Address.City; 
      App.AppData.CurrentStreet = e.Result[0].Information.Address.Street; 

      App.CurrentPosition = e.Result[0].GeoCoordinate; 

      Helper.SaveAppSetting(App.AppData); 

      if (string.IsNullOrEmpty(App.AppData.UserId)) 
      { 
       NavigationService.Navigate(MessageBox.Show(AppResources.UserIdEmptyMsg, AppResources.ApplicationTitle, MessageBoxButton.OKCancel) == MessageBoxResult.OK 
         ? new Uri("/Views/SettingPage.xaml?navCode=userId", UriKind.Relative) 
         : new Uri("/Views/MainPage.xaml", UriKind.Relative)); 
      } 
      else 
      { 
       NavigationService.Navigate(new Uri("/Views/MainPage.xaml", UriKind.Relative)); 
      } 
     } 
    } 
+1

오류에 대한 정보를 제공하십시오. – anderZubi

답변

0

당신은 시험 보고서에 주어진 정보를 제공, 우리는 아마 더 도움이 될 수 있습니다 경우 , 그들의 문서는 일반적으로 자명하다.

인증 요구 사항은 MSDN에 관한 문서이며 위치를 사용하는 응용 프로그램과 관련된 요구 사항은 2.7 절에서 다룹니다.