diff --git a/x/examples/outline-connectivity-app/app_mobile/capacitor.config.json b/x/examples/outline-connectivity-app/app_mobile/capacitor.config.json deleted file mode 100644 index 0fb63bd3..00000000 --- a/x/examples/outline-connectivity-app/app_mobile/capacitor.config.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "appId": "org.outline.sdk.connectivity", - "appName": "@outline_sdk_connectivity_demo/app_mobile", - "webDir": "output/frontend", - "server": { - "url": "http://10.0.2.2:3000", - "cleartext": true - } -} diff --git a/x/examples/outline-connectivity-app/app_mobile/capacitor.config.ts b/x/examples/outline-connectivity-app/app_mobile/capacitor.config.ts new file mode 100644 index 00000000..47c6b8fd --- /dev/null +++ b/x/examples/outline-connectivity-app/app_mobile/capacitor.config.ts @@ -0,0 +1,27 @@ +import { CapacitorConfig } from '@capacitor/cli'; + +let config: CapacitorConfig = { + appId: "org.outline.sdk.connectivity", + appName: "@outline_sdk_connectivity_demo/app_mobile", + webDir: "output/frontend", + server: { + url: "http://10.0.2.2:3000" + } +} + +switch (process.env.CAPACITOR_PLATFORM) { + case "android": + config.server = { + url: "http://10.0.2.2:3000", + cleartext: true + }; + break; + case "ios": + default: + config.server = { + url: "http://localhost:3000" + }; + break; +} + +export default config; diff --git a/x/examples/outline-connectivity-app/app_mobile/package.json b/x/examples/outline-connectivity-app/app_mobile/package.json index 9a33ad90..0db0aa48 100644 --- a/x/examples/outline-connectivity-app/app_mobile/package.json +++ b/x/examples/outline-connectivity-app/app_mobile/package.json @@ -22,8 +22,8 @@ "build:ios": "yarn setup:ios && cap build ios", "clean": "rm -rf output node_modules ios/capacitor-cordova-ios-plugins ios/App/App.xcarchive ios/App/App.xcodeproj/xcuserdata ios/App/App.xcworkspace/xcuserdata ios/App/Pods ios/App/App/public ios/App/App/capacitor.config.json ios/App/App/config.xml", "setup": "concurrently 'yarn:setup:*'", - "setup:android": "yarn build:frontend && cap sync android", - "setup:ios": "yarn build:frontend && cap sync ios", + "setup:android": "yarn build:frontend && CAPACITOR_PLATFORM=android cap sync android", + "setup:ios": "yarn build:frontend && CAPACITOR_PLATFORM=ios cap sync ios", "watch": "concurrently 'yarn:watch:*'", "watch:android": "yarn setup:android && cap open android", "watch:frontend": "vite",