Retrieves the connection status and version semver of the Service Provider in the shape of a ProviderStatus object.
If the Provider is connected, its' version number will be supplied in the returned object. If not, version
will be null
.
import {provider} from 'openfin-notifications';
const status: ProviderStatus = provider.getStatus();
console.log(status.connected ? `Conencted to provider (version ${status.version})` : 'Not connected to provider');
Note: Connection status is only available when the connected provider is verison 0.11.2 or later. For earlier versions, this API will indicate that the provider is disconnected.
Evaluates the provided version against the Providers version.
This will return true
if the Provider version is greater than or equal to the provided version. If not, false
will be returned.
If the Provider is not connected, false
will be returned.
import {provider, VERSION} from 'openfin-notifications';
const hasMatchingProvider: boolean = provider.isConnectedToAtLeast(VERSION);
if (!hasMatchingProvider) {
console.warn('Connected to an older provider version. Some functionality may not be available.');
}
Note: Version information is only available when the connected provider is verison 0.11.2 or later. For earlier versions, this API will indicate that the provider is disconnected.
Version to compare against the Provider version. This should be in semvar format.