Ionic app works with both “ionic serve” and in ionic view, but not with “ionic build ios”

倾然丶 夕夏残阳落幕 提交于 2019-12-13 02:38:10

问题


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.

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.


回答1:


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.



来源:https://stackoverflow.com/questions/37266216/ionic-app-works-with-both-ionic-serve-and-in-ionic-view-but-not-with-ionic-b

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