【问题标题】:Is there any way to ask for location permission programmatically for IOS Cordova Ionic v1?有没有办法以编程方式为 IOS Cordova Ionic v1 请求位置许可?
【发布时间】:2018-07-11 10:52:38
【问题描述】:

除了https://github.com/dpa99c/cordova-plugin-request-location-accuracy,还有其他插件可以在 Cordova Ionic V1 App 中请求位置权限吗?

【问题讨论】:

  • 那个插件有什么问题?

标签: cordova ionic-framework cordova-plugins


【解决方案1】:

除了定位精度插件,我们可以使用 Cordova-open-native-settings 插件。如果我们发现 GPS 已禁用。此插件可帮助我们导航到定位设置选项以手动无法/禁用位置设置。

 <plugin spec="https://github.com/guyromb/Cordova-open-native-settings" />

if (window.cordova && window.cordova.plugins.settings) {
        window.cordova.plugins.settings.open("location", function () {

        },function () {
            alert('failed to open settings');
        }
 );
}

【讨论】:

    猜你喜欢
    • 2011-11-22
    • 2019-10-10
    • 2013-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多