0.9.0 • Published 3 days ago

@acrobits/ipc-sdk v0.9.0

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
3 days ago

Acrobits IPC SDK

Acrobits IPC SDK is intended to be used by any web based application that is running inside a WebView of an Acrobits Cloudsoftphone native app, to communicate with that native app.

Installation

To get started, run:

## npm
npm install @acrobits/ipc-sdk

## pnpm (recommended)
pnpm add @acrobits/ipc-sdk

## yarn
yarn add @acrobits/ipc-sdk

Usage

The SDK is built using TypeScript so you should have detailed type information for all available methods and properties.

// import the IPCManager
import { IPCManager } from '@acrobits/ipc-sdk';

// create an instance of IPCManager
const manager = new IPCManager();

// check if we're not running under a host context
if ((await manager.determineContext()) !== 'host') {
  // we are running in standalone mode or the context couldn't be determined
  // handle any cleanup
  return;
}

// setup listeners for the badge query and lifecycle events
manager.onBadgeQueryRequest(() => {
  // determine the updated badge count
  const count = getLatestCountForBadgeFromSomewhere();

  // send the badge update to the host
  manager.badgeUpdate(count);
});

manager.onLifecycleEvent((eventName: string, payload: <string, unknown>) => {
  // do something to handle the lifecycle event
});

// initialize the IPC connection
await manager.initiateConnection();

// update badge count
await manager.badgeUpdate(12);

// match contacts
const matches = await manager.matchContacts([
  {
    type: 'cloudUsername',
    cloudId: 'MY_CLOUD_ID',
    cloudUsername: 'myUsername'
  },
  {
    type: 'uri',
    cloudId: 'MY_CLOUD_ID',
    uri: 'sip:any-sip-uri'
  },
  {
    type: 'uri',
    cloudId: 'MY_CLOUD_ID',
    uri: 'tel:+1234567890'
  }
]);

for (const detailedContact of matches) {
  console.log({
    cloudId: detailedContact.cloudId,
    cloudUsername: detailedContact.cloudUsername,
    displayName: detailedContact.displayName,
    contactLabel: detailedContact.contactLabel,
    type: detailedContact.type,
    uri: detailedContact.uri,
    profilePictureUrl: detailedContact.profilePictureUrl
  });
}

For more details on the available SDK methods and properties, refer to the documentation.

0.9.0

3 days ago

0.8.1-alpha.20

17 days ago

0.8.1-alpha.19

17 days ago

0.8.1-alpha.18

18 days ago

0.8.1-alpha.17

20 days ago

0.8.1-alpha.16

24 days ago

0.8.1-alpha.15

24 days ago

0.8.1-alpha.14

28 days ago

0.8.1-alpha.13

29 days ago

0.8.1-alpha.11

1 month ago

0.8.1-alpha.12

1 month ago

0.8.1-alpha.10

1 month ago

0.8.1-alpha.9

1 month ago

0.8.1-alpha.8

1 month ago

0.8.1-alpha.6

2 months ago

0.8.1-alpha.7

2 months ago

0.8.1-alpha.4

2 months ago

0.8.1-alpha.5

2 months ago

0.8.1-alpha.2

2 months ago

0.8.1-alpha.3

2 months ago

0.8.1-alpha.1

2 months ago

0.8.1-alpha.0

2 months ago

0.8.0

2 months ago

0.8.0-alpha.6

2 months ago

0.8.0-alpha.5

2 months ago

0.8.0-alpha.4

2 months ago

0.8.0-alpha.3

3 months ago

0.7.2-alpha.5

3 months ago

0.7.2-alpha.6

3 months ago

0.8.0-alpha.2

3 months ago

0.8.0-alpha.1

3 months ago

0.8.0-alpha.0

3 months ago

0.7.2-alpha.2

3 months ago

0.7.2-alpha.3

3 months ago

0.7.2-alpha.4

3 months ago

0.7.2-alpha.0

3 months ago

0.7.2-alpha.1

3 months ago

0.7.1

3 months ago

0.7.0

3 months ago

0.6.3

3 months ago

0.6.2

3 months ago

0.6.1

3 months ago

0.6.0

4 months ago

0.5.6

4 months ago

0.5.5

4 months ago

0.5.4

4 months ago

0.5.3

4 months ago

0.5.2

4 months ago

0.5.0

4 months ago

0.5.1

4 months ago

0.4.1

5 months ago

0.3.0

6 months ago

0.4.0

6 months ago

0.2.1-alpha.0

7 months ago

0.2.0

7 months ago

0.1.8

7 months ago

0.1.7

8 months ago

0.1.6

8 months ago

0.1.5

8 months ago

0.1.5-alpha.1

8 months ago

0.1.5-alpha.0

8 months ago

0.1.4

9 months ago

0.1.3

9 months ago

0.1.2

9 months ago

0.1.1

10 months ago

0.1.0

10 months ago

0.0.15

10 months ago

0.0.14

10 months ago