Using the Glance Desktop SDK
The Glance Desktop SDK allows customers to integrate Glance functionality desktop applications. Glance SDK features include:
- Screen share / Application share
- One-Click Connect
- Viewing video or applications shared by an Agent
Quick Start
Platform-specific integration instructions are available in the glance-networks gitlab repository. There is a separate repository for each platform, each with its own platform specific quick-start README file and sample code.
Supported Platforms
The Glance Desktop SDK is implemented on Windows and macOS. One-Click Connect functionality is in alpha on Windows and not yet implemented on macOS.
Logging
The Glance SDK can optionally log information which can be useful during debugging. The Glance SDK log level can be set to a value from 1-5 for increasing detail.
The SDKs will generate log messages at different levels of verbosity (levels 0 through 5), higher numbers are more verbose:
- 0 = CRITICAL
- 1 = SERIOUS
- 2 = ABNORMAL
- 3 = INTERESTING
- 4 = VERBOSE
- 5 = DEBUG
The default is usually 2 (ABNORMAL). Control of level of logging, the log destination, and some details vary by platform.
Windows
-
Registry setting (versions 5 and below):
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\GlanceNetworks\Log\Levels\Glance
controls log level. -
Registry setting (version 6+):
HKEY_LOCAL_MACHINE\SOFTWARE\GlanceNetworks\Log\Levels\Glance
controls log level. -
Logs are written to
%UserProfile%\AppData\Local\Glance
.
macOS
On macOS, logs are also in daily files in ~Library/Logs/
. It is often convenient to examine logs using the Console application.
Execute the following command line to set the log level to VERBOSE for the SDK or clients:
defaults write com.glancenetworks.Log.Levels Glance -int 4
Calling SDK Functions and Handling Events
The specific mechanics of calling SDK functions and handling events are covered in the platform-specific README files in the glance-networks repository. However there are some general guidelines that are common to all platforms:
- All methods must be called on the main (UI) thread.
- All events are received on an Event Thread. If an application needs to call an SDK method in response to an event, it must delegate that functionality to the main thread. The platform-specific README files have examples showing how to do this on each platform.
Syntax varies between platforms, but the SDK functions and events are the same. References to SDK functions in this document are meant to be generic.
Events
Events have the following attributes:
Event | Attributes |
---|---|
type | Informational, Warning, Error, Assert |
code | An event code, for example EventConnectedToSession |
message | An informational message (English only), suitable for logging |
properties | A collection of properties specific to each event with additional data |
Although an application may need to implement specific handling for certain events, a good practice is to establish a default behavior for each event type:
Event | Default Behavior |
---|---|
Informational | Something of interest has occurred, such as an agent has joined a screen share session. |
Warning | A problem has occurred and the SDK is attempting to address it. For example, if connectivity is lost the SDK fires EventConnectionWarning . If connectivity is restored, EventClearWarning fires. The application may choose to reflect the warning state in the UI, but it is not recommended that user action should be required to dismiss the warning. |
Error | An operation has failed, for example, a session failed to start. |
Assert | The API has been used incorrectly. |
Initialization
You must call GlanceVisitor init
before using the SDK.
Parameters to init
are:
Parameter | Description |
---|---|
Group ID | Group ID provided by Glance. The group ID must be the same on all calls to init. |
Token | Reserved for future use |
Name | Visitor name (optional). If provided, this information will be stored as session metadata. Up to 63 characters. |
Visitor email (optional) Up to 127 characters. | |
Phone | Visitor phone (optional) Up to 31 characters. |
Visitor ID | Unique ID of an authenticated user (optional). A Visitor ID is a string of up to 64 characters, alphanumeric, and dash. The Visitor ID is typically an account or user id associated with an authenticated user. |
init
is typically called:
-
On application startup.
init
should be called without Visitor information if Visitor identity is unknown. -
When a user authenticates.
init
should be called with Visitor information.
The GlancePresenceVisitor
API can only be used after Visitor information has been supplied in a call to init
.
Calling init
multiple times with different visitor IDs is not supported. After the visitor ID is set in a call to init
, it cannot be changed.
GlanceVisitor.init
issues a web service request to look up visitor settings which are needed in order to connect to presence.
The application should wait for an EventVisitorInitialized
event before making any other API calls.
Gesturing
During the session, the agent can:
- Move and Indicate - with their cursor (shows as a colored cursor for the presenter)
- Point - Click for a radiating indication, which will radiate for ~5 seconds
- Gesture - Click-drag a rectangle for indicating an area.
To enable gesturing:
- Log in to Account Management > Settings tab > User Privileges and Settings.
- Under View a guest’s screen > Agent Annotation.
- Selecting the checkbox will turn on Agent gesturing, Point, and Move and Indicate.