locked
About Location Service

    Question

  • So i have set in my manifest that my apps have the Location Capability.

    One of the apps shows a Bing Map right away so the user is asked to grant location permissions to the app.

    By my other app tries to get the user location on a button event (inside a promise) and the getGeopositionAsync method throws an Access denied exception. then if I go to my settings and grant location permissions to my app, the button return the location ok.

    Why is that? Is the Bing Map asking the user for the location permission? Is it because what is asking for the location is running NOT running on the UI thread?

    Regards

     

    http://about.me/sebagomez

    Thursday, November 14, 2013 11:48 AM

Answers

  • Two things: You'll need to call getGeolocationAsync initially from the UI thread to get permission. After that you should be fine calling it from anywhere. From what you describe the map does this for you in the working app.

    The app needs to handle getGeolocationAsync failing gracefully. The user can refuse or retract permission for the app to use location services.

    --Rob


    Thursday, November 14, 2013 2:28 PM
    Owner

All replies

  • Two things: You'll need to call getGeolocationAsync initially from the UI thread to get permission. After that you should be fine calling it from anywhere. From what you describe the map does this for you in the working app.

    The app needs to handle getGeolocationAsync failing gracefully. The user can refuse or retract permission for the app to use location services.

    --Rob


    Thursday, November 14, 2013 2:28 PM
    Owner
  • Great, that's what I thought, thanks.

    Is there a way I can tell Windows to ask the user for permission?


    http://about.me/sebagomez

    Thursday, November 14, 2013 2:51 PM
  • The first time you call getGeolocationAsync it will prompt the user. You cannot forcibly reprompt after that, but the user can grant or refuse permissioj from the settings charm. See Guidelines for location-aware apps (Windows Store apps using C#/VB ...‎ 
    Thursday, November 14, 2013 2:55 PM
    Owner
  • thanks

    http://about.me/sebagomez

    Thursday, November 14, 2013 3:07 PM