locked
Metro Control Panel-> PC Settings ->Privacy- >Let apps use my location

    Question

  • Metro Control Panel-> PC Settings ->Privacy- >Let apps use my location. How do I know whether this is "turned on' or "turned off' Programatically. I tried below. But irrespective of whether I turn on or off I am getting AsyncStatus::Error and Positionstatus as Disabled. Is this the right API?

    Windows::Devices::Geolocation::Geolocator^ locator= ref new Windows::Devices::Geolocation::Geolocator ();
    Windows::Devices::Geolocation::PositionStatus status=  locator->LocationStatus ;
    Windows::Foundation::IAsyncOperation<Windows::Devices::Geolocation::Geoposition^ > ^ operation=  locator->GetGeopositionAsync( );
    operation->Completed= ref new Windows::Foundation::AsyncOperationCompletedHandler<Windows::Devices::Geolocation::Geoposition^>( [locator] (IAsyncOperation<Windows::Devices::Geolocation::Geoposition^>^ operation, Windows::Foundation::AsyncStatus status )
    {
    switch( status)
    {
    case Windows::Foundation::AsyncStatus::Completed:
    {
    Windows::Devices::Geolocation::PositionStatus status=  locator->LocationStatus ;
    }
    break;

    case Windows::Foundation::AsyncStatus::Error:
    {
    Windows::Devices::Geolocation::PositionStatus status=  locator->LocationStatus ;
    break;
    }
    }
    });

    Thursday, September 06, 2012 11:08 AM

All replies

  • I got that to work by adding in the manifest. But now the issue is that there is a prompt which asks whether my app can use your location. I just want to know whether the location option is turned off.  I want to disable some functionality if the option is turned off. I am not interested in knowing the actual location. Is there a way to get it. I really donot want user to see the UI pop up.
    Thursday, September 06, 2012 11:27 AM
  • I'm trying this one as well, starting with the simplest using js so far? Anyone got a solution?

    Wednesday, September 12, 2012 10:35 PM
  • I could not figure out one.
    Thursday, September 13, 2012 8:57 AM