Skip to content

Commit

Permalink
feat(iOS): Adding Capacitor Web APIs (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
theproducer committed Jun 23, 2023
1 parent ffac505 commit 7daa335
Show file tree
Hide file tree
Showing 96 changed files with 3,026 additions and 5,357 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Linting

on:
push:
branches:
- master
pull_request:
branches:
- '**'

jobs:
lint:
name: Lint Code
runs-on: macos-latest
timeout-minutes: 10
steps:
- name: Setup
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.16.0
cache: 'npm'
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Npm Install
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" >> ~/.npmrc
pnpm install
- name: Run Linters
run: pnpm run lint
20 changes: 20 additions & 0 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Unit Tests

on:
pull_request:
branches:
- '**'

jobs:
unittest-ios:
runs-on: macos-13
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: List available Xcode versions
run: ls /Applications | grep Xcode
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_14.3.1.app && /usr/bin/xcodebuild -version
- name: Run ios-engine unit tests
run: cd ./packages/ios-engine && swift package clean && swift test

31 changes: 14 additions & 17 deletions apps/example-app/capacitor.config.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
import { CapacitorConfig } from '@capacitor/cli';
import { CapacitorConfig } from "@capacitor/cli";

const config: CapacitorConfig = {
appId: 'io.ionic.starter',
appName: 'example-app',
webDir: 'build',
appId: "io.ionic.starter",
appName: "example-app",
webDir: "build",
bundledWebRuntime: false,
plugins: {
"BackgroundRunner": {
"runners": [
{
label: "com.example.background",
src: "background.js",
event: "updateSystem",
repeat: false,
interval: 2,
// TODO: Add Android / iOS constraints
}
]
}
}
BackgroundRunner: {
label: "com.example.background.task",
src: "background.js",
event: "monitorLocation",
repeat: true,
interval: 2,
autoStart: true,
// TODO: Add Android / iOS constraints
},
},
};

export default config;

0 comments on commit 7daa335

Please sign in to comment.