【发布时间】:2015-02-11 01:36:12
【问题描述】:
这是我试图在我的 cordova android 应用程序中实现的要求
当用户进入主页时,检查gps是否启用。
如果未启用,我想指示用户打开位置设置。
第一部分使用 GPS 检测器插件轻松完成,第二部分使用 Web Intent 插件实现。但它没有按我预期的那样工作。
if(!gps){
//gps is disabled try to show the location setting using webintent plugin
window.plugins.webintent.startActivity(
{
action: window.plugins.webintent.ACTION_LOCATION_SOURCE_SETTINGS,
},
function() {},
function() {
alert('Failed to open URL via Android Intent.');
console.log("Failed to open URL via Android Intent. URL: " + theFile.fullPath)
}
);
}
我收到此错误Failed to open URL via Android Intent。
【问题讨论】:
-
请帮帮我
-
我遇到了同样的问题,但没有解决
-
你用什么插件来检查gps?请问?
-
我已经创建了自己的 gps 检测器插件,将在我的 github 中更新
标签: android cordova gps ionic-framework cordova-plugins