【问题标题】:Location Settings for Windows PhoneWindows Phone 的位置设置
【发布时间】:2013-05-07 02:51:46
【问题描述】:

如何使用窗口电话 API 显示指向位置设置的链接。我可以显示启用 Wifi 的链接,但在任何地方都找不到如何显示位置设置

【问题讨论】:

    标签: windows-phone-7 geolocation


    【解决方案1】:

    您不能这样做.. 因为位置设置特定于每个应用程序。这也是 MS 期望实现的方式。否则您的应用程序将被拒绝。因此,您的应用程序应该有一个设置选项,用户可以在其中禁用和启用您的应用程序的位置访问。但在访问位置时,您还必须考虑电话位置访问设置。

    GeoCoordinateWatcher g = new GeoCoordinateWatcher();
                g.Start();
                if (g.Permission.Equals(GeoPositionPermission.Granted))
                {
                    // Check application level access and proceed
                }
                else if (g.Permission.Equals(GeoPositionPermission.Denied) || g.Permission.Equals(GeoPositionPermission.Unknown))
                {
                    // Your code/message to the user notifying about location access being disabled at the device level
                }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多