locked
Location permission is disabled by default and no prompt during GetGeopositionAsync() call RRS feed

  • Question

  • Hi all, my post is similar to:

    http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/fb039531-f7f7-4242-ad5f-8710d1b2b9ff

    Every time I reinstall my program I'm not asked for location permission when calling GetGeopositionAsync() and as a result my location status is: Not available. It wasn't like that before. All new copies of my programs are deployed with disabled permission and do not ask to change it. Like there is some cache which says I clicked "No" during first launch and it's not bothering me anymore(when it's first time run). When I explicitly set permissions via WIN-C settings pane it works(but also doesn't ask).

    I wonder if anyone else had it? And how to overcome this issue? Something is wrong here...

    Thanks.

    Friday, September 28, 2012 4:21 PM

Answers

  • apologies, problem solved now. It was called in a wrong thread and thus it threw an exception.
    • Marked as answer by Min ZhuMember Monday, October 8, 2012 5:11 AM
    Tuesday, October 2, 2012 7:29 AM

All replies

  • What exactly do you mean by reinstalling? Are you updating an existing install or are you removing it completely and then installing completely fresh?

    What does your code look like? Where are you calling GetGeopositionAsync()? If you call it in a state where the permission dialog can't be shown then this is expected.

    --Rob

    Friday, September 28, 2012 7:38 PM
    Moderator
  • By reinstalling I mean in metro menu, right click on program tile -> uninstall. Then make sure all the data(except roaming data) is removed from its package folder on C:\Users\<userName>\AppData\Local\Packages\<yourpackage>.

    Then I deploy program from Visual Studio 2012 Ultimate.

    NOTE: I work in simulator, if that's important. I'd wish I could show the code to you, but I subscribe for StatusChange then for PositionChange, then call for the function taking coordinates via GetGeopositionAsync().

    Can you please tell what in which state, the dialog can't be shown? And what do you mean of state, stutus of GeoLocator?

    Saturday, September 29, 2012 2:33 PM
  • apologies, problem solved now. It was called in a wrong thread and thus it threw an exception.
    • Marked as answer by Min ZhuMember Monday, October 8, 2012 5:11 AM
    Tuesday, October 2, 2012 7:29 AM