1.錯(cuò)誤信息:Camera.getPicture: source type 1 not available.
解決方案:在ionic3以后的版本,使用camera插件時(shí),options中的圖片來(lái)源類型,不能用0或1了,需要用枚舉表示。
var sourceType;
if (index == 1) {
sourceType = this.camera.PictureSourceType.CAMERA;
} else if(index == 0){
sourceType = this.camera.PictureSourceType.PHOTOLIBRARY;
}
var options = {
...
sourceType: sourceType,// PHOTOLIBRARY = 0 CAMERA = 1 SAVEDPHOTOALBUM = 2
};
this.camera.getPicture(options).then((imageData) => {
///uploading...
})
2.錯(cuò)誤信息:Archive Upload Successful 成功,但是iTunes不顯示構(gòu)建版本。
解決方案:在使用了cordova調(diào)用設(shè)備api,要在.info.plist中加入對(duì)應(yīng)的權(quán)限提示。
麥克風(fēng)權(quán)限:Privacy - Microphone Usage Description 是否允許此App使用你的麥克風(fēng)?
相機(jī)權(quán)限: Privacy - Camera Usage Description 是否允許此App使用你的相機(jī)?
相冊(cè)權(quán)限: Privacy - Photo Library Usage Description 是否允許此App訪問(wèn)你的媒體資料庫(kù)?
通訊錄權(quán)限: Privacy - Contacts Usage Description 是否允許此App訪問(wèn)你的通訊錄?
藍(lán)牙權(quán)限:Privacy - Bluetooth Peripheral Usage Description 是否許允此App使用藍(lán)牙?
語(yǔ)音轉(zhuǎn)文字權(quán)限:Privacy - Speech Recognition Usage Description 是否允許此App使用語(yǔ)音識(shí)別?
日歷權(quán)限:Privacy - Calendars Usage Description 是否允許此App使用日歷?
定位權(quán)限:Privacy - Location When In Use Usage Description 我們需要通過(guò)您的地理位置信息獲取您周邊的相關(guān)數(shù)據(jù)
定位權(quán)限: Privacy - Location Always Usage Description 我們需要通過(guò)您的地理位置信息獲取您周邊的相關(guān)數(shù)據(jù)
3.ionic3打包iOS包使用xcode build時(shí)報(bào)錯(cuò):
duplicate symbol OBJC_CLASS$_CDVLogger in..
linker command failed with exit code 1 (use -v to see invocation)
解決方案
ionic cordova platform rm ios
ionic cordova platform add ios@4.4.0
4. 隱藏ionic3啟動(dòng)界面的小菊花
解決方案:在config.xml增加如下配置:
<preference name="ShowSplashScreenSpinner" value="false" />
5.ionic使用WKWevView后出現(xiàn)跨域請(qǐng)求:
{"_body":{"isTrusted":true},"status":200,"statusText":"Ok","headers":{},"type":3,"url":null}"
解決方案:強(qiáng)制cordova使用默認(rèn)引擎(UIWebView),參考資料:https://ionicframework.com/docs/wkwebview/
<preference name="CordovaWebViewEngine" value="CDVUIWebViewEngine" />