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.
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.
Optional
hostThe type of the Host
app the Client
is embedded in.
Returns 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.
Sends the current badge count to the Host
app.
The count to update the badge to.
Optional. Whether the update is for an activity instead of a badge.
Determines if the app is embedded in a Host app or native CSP clients.
A promise with IPCContext the app is running under.
Initiates the IPC handshake with the Host
app.
Matches 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.
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.
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.
An 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
Requests the Host
app to provide the Push Token for the current device.
A promise with the Push Token as string
.
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
.
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
.
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.
Initiates a SIP call to the given ContactItem.
ContactItem for the callee.
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.