使用ionic2移动应用在IOS中遇到的问题
在公司工作,正在开发一款APP,途中打包成ios安装测试时,发现:
1、应用在Android中正常运行,在iphone6s中也没有出现什么太大问题(当然我们这里不提运行流畅度的问题),而在低版本的ios中却发现,在首页的菜单 点了居然没有什么反应,而本来应打开新的页面的。一直以为是ionic2在ios低版本的兼容问题。然后在 xcode 中再次打包运行的时候,发现 当我点击某个菜单要进入页面的时候报错了,以至于没有打开新的页面(当然在android中和iphone6s中没出现过)。
出现如下错误:ERROR: Unhandled Promise rejection: Can't find variable: Intl; Zone: angular ; Task: Promise.then ; Value: ReferenceError: Can't find variable: Intrl
最主要的还是这句 Can't find variable: Intl。当然自己也百思不得其姐,错了,是解。于是 google 了好几下,找到了解决方案,原文如下:
(Ionic 2, Using Angular 2 Pipe breaks on iOS—“Can't find variable: Intl”)
Ionic 2, Using Angular 2 Pipe breaks on iOS—“Can't find variable: Intl”
| up vote 15 down vote favorite 2 | Experiencing the same problem with the date, percent, and currency pipes when using them in a template— For example, I'm using a simple percent pipe:
It works when running on Chrome, but when I deploy to an iOS device, it throws this error:
Has anyone else run into this problem? Any suggestions or help would be greatly appreciated! Thanks! ios angularjs ionic-framework angular2 ionic2 |
npm install --save intl
import 'intl'; import 'intl/locale-data/jsonp/en';
(另一个人的回复)
加入那样的一句话:
完美解决问题~~~ 23333333
2、这里还有一个小问题的提示:你在发现当点击某个菜单时,会发现在ios中会有某名的延迟,这样的延迟就好像我们没点到菜单一样,或者点击了没什么反应。以为是ionic2在ios上的性能问题,后来突发奇想将 放置在菜单上的click事件修改为touchstart事件,显然这种延迟就没有了。不妨试试。
(但是,这里仍有个疑问:为啥我看到的教程是使用click事件,却不使用touchstart事件呢?)
** ionic2 中可添加 tappable 属性到元素上避免click事件延迟触发。
3、在ios中iframe加载不了网页的问题(iframe白屏)
在config.xml中添加:
在index.html文件中添加:
4、iOS-Xcode上传后iTunes Connect构建版本不显示
参考: iOS-Xcode上传后iTunes Connect构建版本不显示
解决:
麦克风权限:
Privacy - Microphone Usage Description 是否允许此App使用您的麦克风?
Privacy - Photo Library Usage Description 是否允许此App访问您的相册?
Privacy - Camera Usage Description 是否允许此App使用您的相机?
Privacy - Contacts Usage Description 是否允许此App访问您的通讯录?
Privacy - Location Always Usage Description 是否允许此App访问您的地理位置?
Privacy - Location When In Use Usage Description 是否允许此App访问您的地理位置?
Privacy - Bluetooth Peripheral Usage Description 是否许允此App使用蓝牙?
Privacy - Calendars Usage Description 是否允许此App使用日历?
Next Steps
Resources
解决:
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
