Skip to content

Commit

Permalink
Merge branch 'main-capacitor5' into main-capacitor2
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
#	package.json
  • Loading branch information
maximzhemerenko committed Aug 31, 2024
2 parents d68d130 + 4af1140 commit 05bc660
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ Capacitor Socket Connection Plugin
## Install

```bash
npm install @spryrocks/capacitor-socket-connection-plugin@2.1.9
npm install @spryrocks/capacitor-socket-connection-plugin@2.3.0
```

see [main](https://github.com/SpryRocks/capacitor-socket-connection-plugin/tree/main) branch for capacitor 6

see [main-capacitor5](https://github.com/SpryRocks/capacitor-socket-connection-plugin/tree/main) branch for capacitor 5

## Usage
Expand All @@ -30,8 +32,9 @@ socket.onData = function(data) {

##### Callback function parameters


| Name | Type |
|------|------------|
| ---- | ---------- |
| data | Uint8Array |

#### onClose
Expand All @@ -52,11 +55,13 @@ socket.onError = function(error) {

##### Callback function parameters


| Name | Type |
|-------|---------|
| ----- | ------- |
| error | unknown |

#### onStateChanges

```typescript
socket.onStateChanged = function(state) {
// handle socket state change
Expand All @@ -65,10 +70,11 @@ socket.onStateChanged = function(state) {

##### Callback function parameters

| Name | Type |
|-------|--------------|
| state | SocketState |


| Name | Type |
| ----- | ----------- |
| state | SocketState |

### Connect socket to endpoint

```typescript
Expand All @@ -77,8 +83,9 @@ await socket.open(host, port);

#### Parameters


| Name | Type |
|------|--------|
| ---- | ------ |
| host | String |
| port | Number |

Expand All @@ -90,8 +97,9 @@ await socket.write(data);

#### Parameters


| Name | Type |
|------|------------|
| ---- | ---------- |
| data | Uint8Array |

### Close socket connection
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spryrocks/capacitor-socket-connection-plugin",
"version": "2.3.0-alpha.7",
"version": "2.3.0",
"description": "Capacitor Socket Connection Plugin",
"main": "dist/plugin.cjs.js",
"module": "dist/esm/index.js",
Expand Down

0 comments on commit 05bc660

Please sign in to comment.