Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The `/docs` folder houses all markdown files. The page structure loosely maps to

## Versioning

This folder can also contain components, assets, and whatever else is meant to be versioned when the docusaurus versioning script is run. For example, if there is a page component that is only relevant to the `layout` section in the current version of Ionic, it could be added to a `_components/` folder in `docs/layout/`. When the versioning script is run, the component will be copied to `versioned_docs/verion-{X}/layout/_components/` and there will now be a separate component in `docs/layout/_components/` that can be deleted or updated to the latest version. The same concept applies to images and other files.
This folder can also contain components, assets, and whatever else is meant to be versioned when the docusaurus versioning script is run. For example, if there is a page component that is only relevant to the `layout` section in the current version of Ionic, it could be added to a `_components/` folder in `docs/layout/`. When the versioning script is run, the component will be copied to `versioned_docs/version-{X}/layout/_components/` and there will now be a separate component in `docs/layout/_components/` that can be deleted or updated to the latest version. The same concept applies to images and other files.

If components are meant to be shared across versions, they can be put in `src/components/`. If images and other served files are meant to be shared across versions they can be put in `static/`.

Expand Down
2 changes: 1 addition & 1 deletion docs/apis/action-sheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,6 @@ to select.
| ----------------- | -------------------------- | ----------------------------------------------------------------------------------------------------------- | ----- |
| **`Default`** | <code>'DEFAULT'</code> | Default style of the option. | 1.0.0 |
| **`Destructive`** | <code>'DESTRUCTIVE'</code> | Style to use on destructive options. | 1.0.0 |
| **`Cancel`** | <code>'CANCEL'</code> | Style to use on the option that cancels the Action Sheet. If used, should be on the latest availabe option. | 1.0.0 |
| **`Cancel`** | <code>'CANCEL'</code> | Style to use on the option that cancels the Action Sheet. If used, should be on the latest available option. | 1.0.0 |

</docgen-api>
2 changes: 1 addition & 1 deletion docs/apis/background-runner.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ backgrounded.
| **`src`** | <code>string</code> | The path to the runner JavaScript file, relative to the app bundle. | 1.0.0 |
| **`event`** | <code>string</code> | The name of the event that will be called when the OS executes the background task. | 1.0.0 |
| **`repeat`** | <code>boolean</code> | If background task should repeat based on the interval set in `interval`. | 1.0.0 |
| **`interval`** | <code>number</code> | The number of minutes after the the app is put into the background in which the background task should begin. If `repeat` is true, this also specifies the number of minutes between each execution. | 1.0.0 |
| **`interval`** | <code>number</code> | The number of minutes after the app is put into the background in which the background task should begin. If `repeat` is true, this also specifies the number of minutes between each execution. | 1.0.0 |
| **`autoStart`** | <code>boolean</code> | Automatically register and schedule background task on app load. | 1.0.0 |

### Examples
Expand Down
2 changes: 1 addition & 1 deletion docs/apis/geolocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Not available on web.
| **`enableHighAccuracy`** | <code>boolean</code> | High accuracy mode (such as GPS, if available) On Android 12+ devices it will be ignored if users didn't grant ACCESS_FINE_LOCATION permissions (can be checked with location alias). | <code>false</code> | 1.0.0 |
| **`timeout`** | <code>number</code> | The maximum wait time in milliseconds for location updates. In Android, since version 7.1.0 of the plugin, it is also used to determine the interval of location updates for `watchPosition`. | <code>10000</code> | 1.0.0 |
| **`maximumAge`** | <code>number</code> | The maximum age in milliseconds of a possible cached position that is acceptable to return | <code>0</code> | 1.0.0 |
| **`minimumUpdateInterval`** | <code>number</code> | The minumum update interval for location updates. If location updates are available faster than this interval then an update will only occur if the minimum update interval has expired since the last location update. This parameter is only available for Android. It has no effect on iOS or Web platforms. | <code>5000</code> | 6.1.0 |
| **`minimumUpdateInterval`** | <code>number</code> | The minimum update interval for location updates. If location updates are available faster than this interval then an update will only occur if the minimum update interval has expired since the last location update. This parameter is only available for Android. It has no effect on iOS or Web platforms. | <code>5000</code> | 6.1.0 |
| **`enableLocationFallback`** | <code>boolean</code> | This option applies to Android only. Whether to fall back to the Android framework's `LocationManager` in case Google Play Service's location settings checks fail. This can happen for multiple reasons - e.g. device has no Play Services or device has no network connection (Airplane Mode) If set to `false`, failures are propagated to the caller. Note that `LocationManager` may not be as effective as Google Play Services implementation. If the device's in airplane mode, only the GPS provider is used, which may take longer to return a location, depending on GPS signal. This means that to receive location in such circumstances, you may need to provide a higher timeout. | <code>true</code> | 8.0.0 |


Expand Down
10 changes: 5 additions & 5 deletions docs/apis/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Make a Http DELETE Request to a server using native libraries.
| **`data`** | <code>any</code> | Additional data received with the Http response. |
| **`status`** | <code>number</code> | The status code received from the Http response. |
| **`headers`** | <code><a href="#httpheaders">HttpHeaders</a></code> | The headers received from the Http response. |
| **`url`** | <code>string</code> | The response URL recieved from the Http response. |
| **`url`** | <code>string</code> | The response URL received from the Http response. |


#### HttpHeaders
Expand Down Expand Up @@ -287,9 +287,9 @@ https://nodejs.org/api/buffer.html#class-blob

#### ArrayBuffer

Represents a raw buffer of binary data, which is used to store data for the
different typed arrays. ArrayBuffers cannot be read from or written to directly,
but can be passed to a typed array or DataView Object to interpret the raw
Represents a raw buffer of binary data, which is used to store data for the
different typed arrays. ArrayBuffers cannot be read from or written to directly,
but can be passed to a typed array or DataView Object to interpret the raw
buffer as needed.

| Prop | Type | Description |
Expand Down Expand Up @@ -550,7 +550,7 @@ https://nodejs.org/api/url.html#class-urlsearchparams

#### Uint8Array

A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
requested number of bytes could not be allocated an exception is raised.

| Prop | Type | Description |
Expand Down
2 changes: 1 addition & 1 deletion docs/apis/inappbrowser.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ Defines the options for opening a URL in the web view.
| **`allowOverScroll`** | <code>boolean</code> | Turns on the Web View bounce property. |
| **`enableViewportScale`** | <code>boolean</code> | Prevents viewport scaling through a meta tag. |
| **`allowInLineMediaPlayback`** | <code>boolean</code> | Allows in-line HTML5 media playback, displaying within the browser window rather than a device-specific playback interface. Note: The HTML's video element must also include the webkit-playsinline attribute. |
| **`surpressIncrementalRendering`** | <code>boolean</code> | Waits until all new view content is received before being rendered. |
| **`suppressIncrementalRendering`** | <code>boolean</code> | Waits until all new view content is received before being rendered. |
| **`viewStyle`** | <code><a href="#iosviewstyle">iOSViewStyle</a></code> | Sets the presentation style of the Web View. |
| **`animationEffect`** | <code><a href="#iosanimation">iOSAnimation</a></code> | Sets the transition style of the Web View. |
| **`allowsBackForwardNavigationGestures`** | <code>boolean</code> | Enables back and forward swipe gestures in the Web View. |
Expand Down
2 changes: 1 addition & 1 deletion docs/apis/local-notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Starting on Android 12, scheduled notifications won't be exact unless this permi
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
```

Note that even if the permission is present, users can still disable exact notifications from the app settings. Use `checkExactNotificationSetting()` to check the the value of the setting. If a user disables this setting, the app will restart and any notification scheduled with an exact alarm will be deleted. If your application depends on exact alarms, be sure to check this setting on app launch (for example, in [`App.appStateChange`](https://capacitorjs.com/docs/apis/app#addlistenerappstatechange-)) in order to provide fallbacks or alternative behavior.
Note that even if the permission is present, users can still disable exact notifications from the app settings. Use `checkExactNotificationSetting()` to check the value of the setting. If a user disables this setting, the app will restart and any notification scheduled with an exact alarm will be deleted. If your application depends on exact alarms, be sure to check this setting on app launch (for example, in [`App.appStateChange`](https://capacitorjs.com/docs/apis/app#addlistenerappstatechange-)) in order to provide fallbacks or alternative behavior.

On Android 14, there is a new permission called `USE_EXACT_ALARM`. Use this permission to use exact alarms without needing to request permission from the user. This should only be used if the use of exact alarms is central to your app's functionality. Read more about the implications of using this permission [here](https://developer.android.com/reference/android/Manifest.permission#USE_EXACT_ALARM).

Expand Down
18 changes: 9 additions & 9 deletions docs/apis/watch.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The Capacitor Watch plugin allows you to define a UI for a watch in your web cod

This currently only supports iOS. This guide assumes you've already added iOS to your capcacitor project.

Also note - all of this will only work with an actual Apple Watch. Simulators don't allow the app<->watch communcation like real devices do.
Also note - all of this will only work with an actual Apple Watch. Simulators don't allow the app<->watch communication like real devices do.

## Install

Expand All @@ -55,7 +55,7 @@ Add the 'Background Modes' and 'Push Notification' capabilities. Then in the Bac

Step 3

Open `AppDelegate.swift` and add `import WatchConnectivity` and `import CapactiorWatch` to the top of the file, and the following code inside the `application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?)` method:
Open `AppDelegate.swift` and add `import WatchConnectivity` and `import CapacitorWatch` to the top of the file, and the following code inside the `application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?)` method:

```swift
assert(WCSession.isSupported(), "This sample requires Watch Connectivity support!")
Expand Down Expand Up @@ -83,7 +83,7 @@ We're going to add the code that makes Capacitor Watch work in the watch applica

If you are using <b>Xcode 15 or beyond</b> you then need to add the Capacitor Watch Swift Package from your node_modules:

First go to the project package dependancies
First go to the project package dependencies

<img src="https://raw.githubusercontent.com/ionic-team/CapacitorWatch/main/img/spm-project-dependancies.png" />

Expand All @@ -99,7 +99,7 @@ Then in the column on the right pick your watch app to be the target and click '

<img src="https://raw.githubusercontent.com/ionic-team/CapacitorWatch/main/img/spm-pick-target.png" />

Once this is done your Package Dependancies should look like this:
Once this is done your Package Dependencies should look like this:

<img src="https://raw.githubusercontent.com/ionic-team/CapacitorWatch/main/img/spm-finished.png" />

Expand Down Expand Up @@ -151,7 +151,7 @@ You can still develop your iOS app like a normal capacitor app, but getting thin

The right half of this bar lets you pick the destination device or simulator. You will need to pick the watch paired with the phone and then hit the 'Run' button or use the 'cmd+r' run shortcut.

There can be some challenges in syncing the watch and phone apps. Sometimes you will get an error in the xcode console complaining the compainion app is not present. The best solution in this case is to re-build and re-install the apps on both devices.
There can be some challenges in syncing the watch and phone apps. Sometimes you will get an error in the xcode console complaining the companion app is not present. The best solution in this case is to re-build and re-install the apps on both devices.

## Building the watch UI and sending it to the watch

Expand All @@ -177,23 +177,23 @@ Will produce this:

This article provides a great summary on the native methods and their implications: https://alexanderweiss.dev/blog/2023-01-18-three-ways-to-communicate-via-watchconnectivity

On the phone side, you can implement these methods using the Capacitor Background Runner Plugin (https://github.com/ionic-team/capacitor-background-runner). Currently the watch plugin will mainly handle the `didReceiveUserInfo` method, and you can recieve envents from the watch while your app is in the background using the following code in your runner.js:
On the phone side, you can implement these methods using the Capacitor Background Runner Plugin (https://github.com/ionic-team/capacitor-background-runner). Currently the watch plugin will mainly handle the `didReceiveUserInfo` method, and you can receive events from the watch while your app is in the background using the following code in your runner.js:

```javascript
addEventListener("WatchConnectivity_didReceiveUserInfo", (args) => {
console.log(args.message.jsCommand);
})
```

You can also implment the `runCommand` event listener for foreground procesing:
You can also implement the `runCommand` event listener for foreground processing:

```typescript
Watch.addListener("runCommand", (data: {command: string}) => {
console.log("PHONE got command - " + data.command);
})
```

The commands are the 2nd paramter in the `Button()` definition of the watch UI. This can be any string.
The commands are the 2nd parameter in the `Button()` definition of the watch UI. This can be any string.

## Updating watch data

Expand All @@ -216,7 +216,7 @@ async function counterIncrement() {
}
```

# Persistance on the Watch
# Persistence on the Watch

Capacitor Watch will persist the last UI you sent with `updateWatchUI()`. State from `updateWatchData()` is NOT preserved.

Expand Down
Loading