Hello !
Thanks to Ionic, I have an Android App that makes successful API calls to a remote server I own. Thank you Ionic!
However, I recently tried building for ios and I’m running into an issue.
I use CapacitorHttp (import from capacitor/core) to make the API calls within my code.
It works fine in Android but not in IOs.
I wish I could paste some errors from the console but that’s my issue: nothing happens when the API call is made.
No feedback or error from Xcode, just… no behavior at all.
I tried logging the CapacitorHttp object and the method call “CapacitorHttp.post(options);”
but nothing comes up in the Xcode console, just “{}”.
I’m thinking I miss some configuration but I can’t find what.
Here is my config:
Ionic:
Ionic CLI : 7.1.1 (/opt/homebrew/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/vue 6.3.8
Capacitor:
Capacitor CLI : 4.5.0
@capacitor/android : 4.5.0
@capacitor/core : 4.5.0
@capacitor/ios : 4.5.0
Utility:
cordova-res : not installed globally
native-run (update available: 2.0.0) : 1.7.1
System:
NodeJS : v21.1.0 (/opt/homebrew/Cellar/node/21.1.0/bin/node)
npm : 10.2.3
OS : macOS Unknown
Capacitor config: import { CapacitorConfig } from ‘@capacitor/cli’;
const config: CapacitorConfig = {
appId: 'eu…,
appName: 'my app name,
webDir: ‘dist’,
bundledWebRuntime: false,
server: { “androidScheme”: “http”, “allowNavigation”: [ “127.0.0.1” ] },
plugins: {
CapacitorHttp: {
enabled: true,
},
},
ios:{
includePlugins: [ “CapacitorHttp” ]
}
};
export default config; ionic.config:
{
“name”: “intercambio”,
“integrations”: {
“capacitor”: {}
},
“type”: “vue”
}
Package: {
“name”: “intercambio”,
“version”: “0.0.1”,
“private”: true,
“scripts”: {
“serve”: “vue-cli-service serve”,
“build”: “vue-cli-service build”,
“test:unit”: “vue-cli-service test:unit”,
“test:e2e”: “vue-cli-service test:e2e”,
“lint”: “vue-cli-service lint”
},
“dependencies”: {
“@awesome-cordova-plugins/http”: “^6.4.0”,
“@capacitor/android”: “4.5.0”,
“@capacitor/app”: “4.1.1”,
“@capacitor/camera”: “^4.1.4”,
“@capacitor/core”: “4.5.0”,
“@capacitor/device”: “^4.1.0”,
“@capacitor/haptics”: “4.1.0”,
“@capacitor/ios”: “4.5.0”,
“@capacitor/keyboard”: “4.1.0”,
“@capacitor/preferences”: “^4.0.2”,
“@capacitor/status-bar”: “4.1.0”,
“@ionic-native/http”: “^5.36.0”,
“@ionic/vue”: “^6.0.0”,
“@ionic/vue-router”: “^6.0.0”,
“axios”: “^1.2.3”,
“cordova-plugin-advanced-http”: “^3.3.1”,
“core-js”: “^3.6.5”,
“ionicons”: “^6.0.3”,
“vue”: “^3.2.21”,
“vue-i18n”: “^9.2.2”,
“vue-router”: “^4.0.12”,
“vuex”: “^4.1.0”
},
“devDependencies”: {
“@capacitor/cli”: “4.5.0”,
“@types/jest”: “^27.0.2”,
“@typescript-eslint/eslint-plugin”: “^5.6.0”,
“@typescript-eslint/parser”: “^5.6.0”,
“@vue/cli-plugin-babel”: “~5.0.0-rc.1”,
“@vue/cli-plugin-e2e-cypress”: “~5.0.0-rc.1”,
“@vue/cli-plugin-eslint”: “~5.0.0-rc.1”,
“@vue/cli-plugin-router”: “~5.0.0-rc.1”,
“@vue/cli-plugin-typescript”: “~5.0.0-rc.1”,
“@vue/cli-plugin-unit-jest”: “~5.0.0-rc.1”,
“@vue/cli-service”: “~5.0.0-rc.1”,
“@vue/eslint-config-typescript”: “^9.1.0”,
“@vue/test-utils”: “^2.0.0-rc.16”,
“@vue/vue3-jest”: “^27.0.0-alpha.3”,
“babel-jest”: “^27.3.1”,
“cypress”: “^8.7.0”,
“eslint”: “^8.4.1”,
“eslint-plugin-vue”: “^8.2.0”,
“jest”: “^27.3.1”,
“ts-jest”: “^27.0.7”,
“typescript”: “^4.3.5”
},
“description”: “An Ionic project”
}