离子应用程序与“离子服务”并且在离子视图中,但不与“离子构建ios” [英] Ionic app works with both "ionic serve" and in ionic view, but not with "ionic build ios"

查看:111
本文介绍了离子应用程序与“离子服务”并且在离子视图中,但不与“离子构建ios”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的离子应用使用google api地理位置服务,并且在我使用离子服务和Ionic View应用运行时运行良好。但是,当我运行ionic build ios并在我的ios设备上运行应用程序时,地理位置服务不起作用。
我认为这是因为位置服务不在。我去设置>隐私>定位服务,以允许定位服务,但是,我意识到我正在工作的应用程序不在那里列出。 (但有离子视图应用程序图标和位置服务是允许的,我认为这就是为什么它可以与离子视图应用程序一起使用)。此外,我意识到,该应用程序甚至没有在设置上列出。

My ionic app uses google api geolocation service and works fine when I run it using "ionic serve" and with Ionic View app. However, when I run "ionic build ios" and run the app on my ios device, the geolocation service does not work. I thought it was because location service was not on. I went to setting > Privacy > Location Service to allow location service however, I realized that the app I am working on is not listed there. (But there is ionic view app icon and the location service is allowed. I think that's why it works with ionic view app). Also I realized that the app is not even listed on setting.

如何在ios中设置离子应用程序(ionic build ios)以便我可以更改位置服务的许可权?

How can I list ionic app ("ionic build ios") on setting in ios so that I can change permission for location service?

任何建议将不胜感激。提前致谢。

Any suggestions will be appreciated. Thanks in advance.

推荐答案

可能你需要 GeoLocation 插件可以访问手机中的位置服务。尝试将其添加到

May be you need the GeoLocation plugin to get access of location services in your phone. Try adding it by

cordova plugin add cordova-plugin-geolocation

,然后在手机开始使用其服务时允许访问它。这样你的应用程序也会在位置服务设置中列出。

and then allow access to it when it start using its services in your phone. This way your app will be listed in the location service settings too.

这篇关于离子应用程序与“离子服务”并且在离子视图中,但不与“离子构建ios”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆