A class that manages the IPC communication between the Client
and the Host
.
Optional
logger: ILoggerAn optional logger instance to use for logging. If not provided, a default logger will be used.
Ideally, there should only be one instance of the IPCManager in the app. It is recommended to create the instance as a singleton and use it throughout the app.
Optional
cloudThe cloud ID of the Host
app the Client
is embedded in.
Optional
cloudThe cloud username of the logged in user.
Optional
displayThe display name of the logged in user.
Private
helperOptional
hostThe type of the Host
app the Client
is embedded in.
Private
listenersPrivate
loggerReturns whether the app is running inside a native WebView (host
context) or as a
standalone
app.
Determines if the app is connected to a Host
app.
The negotiated IPC protocol version.
Determines if the app is embedded in a Host app or native CSP clients.
A promise with IPCContext the app is running under.
Private
evaluateMatches batch of ContactItem objects against the Host's contact list to fetch detailed contact information.
List of ContactItem collection to match against the Host's contact list.
A collection of DetailedContactItem objects which were matched against the Host's contact list.
Registers a callback to be invoked when a IPCEvents.BadgeQuery is received.
A callback function to be invoked when a IPCEvents.BadgeQuery event is received.
An unsubscribe callback to remove the listener.
Registers a callback to be invoked when a IPCEvents.Lifecycle event is received.
A callback function to be invoked when a IPCEvents.Lifecycle event is received.
An unsubscribe callback to remove the listener.
The eventName
and payload
are defined by the Host
app and can vary for each LIFECYCLE
event. The payload can be an empty object for events without any additional data.
Registers a callback to be invoked when a IPCEvents.PushToken event is received.
A callback function to be invoked when a IPCEvents.PushToken event is received.
An unsubscribe callback to remove the listener.
The token
, appId
, selector
and expiry
are defined by the Host
app and can vary for
each Push Token event.
Registers a callback to be invoked when a IPCEvents.RequestLogs event is received.
A callback function to be invoked when a IPCEvents.RequestLogs event is received. The callback receives an optional skipCompression parameter.
Optional
skipCompression: booleanAn unsubscribe callback to remove the listener.
The Host app can request logs from the Client app by sending a RequestLogs event. The callback will receive a skipCompression parameter indicating whether the logs should be compressed or not.
When skipCompression is true, the logs should be sent uncompressed. When false or undefined, the logs should be compressed before sending.
Requests the Host
app to open the given URL in an external browser.
URL to open in the external browser
Optional
data: TDataOptional. Any additional data to be sent along with the URL
Any additional data to be posted alongside the URL is included with the data
parameter.
Requests the Host
app to open the contact selection UI.
An identifier for the message stream
Configuration options for contact selection:
mode
: Whether to allow 'single' or 'multi' contact selectioncurrentContacts
: For multi-select mode, the list of currently selected contactscontactType
: The type of contacts to select ('cloudUsername' or 'uri'). Defaults to 'cloudUsername'includeOffNetworkContacts
: Whether to include contacts not on the network. Defaults to falseA collection of ContactItem objects which the user selected
Requests the Host
app to open the contact selection UI.
An identifier for the message stream
Optional
mode: "single"Optional. Whether to allow single
or multi
contact selection.
Optional
contactType: ContactTypeOptional. The type of contacts to be selected. This can be either
cloudUsername
or uri
. Defaults to cloudUsername
.
A collection of ContactItem objects which the user selected along with the
corelationId
.
Use the selectContacts
method with the options
parameter instead.
When requesting a single
contact, the Host
app will return immediately
after contact selection.
Requests the Host
app to open the contact selection UI.
An identifier for the message stream
Whether to allow single
or multi
contact selection.
A list of ContactItem objects that are currently selected. This is used to highlight the current contacts from the selection UI.
Optional
contactType: ContactTypeOptional. The type of contacts to be selected. This can be either
cloudUsername
or uri
. Defaults to cloudUsername
.
A collection of ContactItem objects which the user selected along with the
corelationId
.
Use the selectContacts
method with the options
parameter instead.
When requesting a multi
contact, the user will have to manually close the contact selection
UI. The Host
app will return the selected contacts when the user closes the UI.
When requesting a multi
contact, the currentContacts
parameter is required. This will
be used to highlight the contacts that are already selected.
Private
selectOptional
currentContacts: ContactItem[]Optional
contactType: ContactTypePrivate
selectInitiates a SIP call to the given ContactItem.
ContactItem for the callee.
Generated using TypeDoc
A class that manages the IPC communication between the
Client
and theHost
.Remarks
Ideally, there should only be one instance of the IPCManager in the app. It is recommended to create the instance as a singleton and use it throughout the app.