Blackberry 10 Webworks with Worklight Geolocation

孤街醉人 提交于 2019-12-12 04:46:41

问题


I'm working with Worklight 6.1 and WebWorks SdK 2.1 for BlackBerry 10.

my issue is when I try to get the User location invoking this function :

navigator.geolocation.getCurrentPosition(
    onSuccessGeo, onErrorGeo, {enableHighAccuracy: true});

I get this error :

TypeError: 'undefined' is not an object (evaluating 'e.code') geolocation.js:115

Though when I run a sample project based on Webworks SDK 2.1, with cordova, the geolocation works fine.

I made the same configuration and permissions for the 2 projects, both with Worklight and without Worklight.

Did I miss something?


回答1:


I resolved this issue by replacing Geolocation plugin of Worklight by the one generated by Webworks SDK 2.1.

So you have to copy the Geolocation Plugin under :

ProjectFolder/plugin/org.apache.cordova.geolocation

and past it under :

/ProjectFolder/webresources/default/worklight/plugins/org.apache.cordova.geolocation

------->

That's all, hope it will help you if you'll face such problem.



来源:https://stackoverflow.com/questions/23951511/blackberry-10-webworks-with-worklight-geolocation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!