Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want take people location who use my program. But I cant access. Because I havent allow for this function.
There is my code. How can I access?
C#
public async void KoordinatBel()
       {
           Geolocator location = new Geolocator();
           try
           {
               location.DesiredAccuracy = PositionAccuracy.High;
               Geoposition pos = await location.GetGeopositionAsync();
               var lat = pos.Coordinate.Latitude;
               var lang = pos.Coordinate.Longitude;
               MessageDialog yeni = new MessageDialog(lang.ToString() + ' ' + lat.ToString());
               yeni.ShowAsync();


           }
           catch (System.UnauthorizedAccessException)
           {

           }
       }

thanks in advance
Posted
Updated 16-Jul-13 2:13am
v3

1 solution

The first use of the Geolocator object to call GetGeopositionAsync or subscribe to PositionChanged events must be made on the UI thread so that the consent prompt can be shown to the user.
Guidelines for devices that access personal data[^]
 
Share this answer
 
Comments
berkayerdi 16-Jul-13 8:12am    
Thanks. I add Location to Declarations and my problem is solved ^^.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900