IntegrationsManager class abstract

Provides methods to manage the user's integrations with fitness data providers. Connecting a user to an integration means that fitness data from that integration will be synced and made available for this user.

NOTE: The manager maintains state and is designed to be used as a singleton.

Constructors

IntegrationsManager()

Properties

connectionEvents Stream<ConnectionEvent>
Whenever a user completes an integration connection, a ConnectionEvent is emitted indicating the connection code. The ConnectionEvent contains the integration identifier and the IntegrationConnectionCode.
no setter
disconnectionEvents Stream<DisconnectionEvent>
Whenever a user completes an integration disconnect, a DisconnectionEvent is emitted. The DisconnectionEvent contains the IntegrationIdentifier.
no setter
hashCode int
The hash code for this object.
no setterinherited
integrations Stream<List<IntegrationModel>>
The complete list of integrations for the current user. A sync process may cause an emission of new integrations.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

canHandleAuthorizeResponseFromUrl(Uri response) bool
Determines if the given URL can be handled by this manager. Typically this is used to check whether a deep linked URL can be handled such as the redirected URL from an integration connect action.
connect(String integrationIdentifier, Future<void> authorizeAction(Uri)) Future<void>
Connects the NXFit user to the specified integration. This method supports two basic flows: those that require user authorization and those that do not.
disconnect(String integrationIdentifier) Future<void>
Disconnects the integration with the given integrationIdentifier. The current user will no longer have fitness data sent to the NxFit service from the integration. May cause an emission on the disconnectionEvents Stream.
handleAuthorizeResponse(String integrationIdentifier, String connectionResultCode) Future<IntegrationConnectionCode>
Will decode the connection result code and will emit a ConnectionEvent with the IntegrationConnectionCode for the integration. The emitted IntegrationConnectionCode is also returned to the caller.
handleAuthorizeResponseFromUrl(Uri response) Future<IntegrationConnectionCode>
Will decode the URI and will emit a ConnectionEvent with the IntegrationConnectionCode for the integration. The emitted IntegrationConnectionCode is also returned to the caller.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refreshIntegrations() Future<void>
Will sync the user's integrations with the NxFit service. Any new or updated integrations will be emitted by the integrations stream.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

build(String baseRedirectUri, AuthProvider authProvider, IntegrationClient client) Future<IntegrationsManager>
Builds a concrete instance of the IntegrationsManager abstraction. This should only be used if NxFitManagers is not used.