DeviceInformation class abstract

The object containing information of the device where the SDK is running.

For nevisFIDO to be able to generate encrypted out-of-band payloads that can only be decrypted by your application, a DeviceInformation must be provided during registration. During registration you must provide the name and optionally the fcmRegistrationToken. The other information exposed by the DeviceInformation (deviceId and idUsernamePairs) are generated by the SDK and are not required during registration.

For nevisFIDO to be able to dispatch tokens using the Firebase Cloud Messaging infrastructure, the device information fcmRegistrationToken must be filled with the token (as defined by Firebase). This registration token is associated with the mobile device receiving the push notifications.

There is a single DeviceInformation for all accounts. It is created when the first successful registration is completed, and it is deleted when the last authenticator (and thus the last account) is removed (using the Deregistration or LocalData.deleteAuthenticator. When a DeviceInformation is provided in a registration operation, and a DeviceInformation is already defined (that is, there is already a registered authenticator), the provided DeviceInformation will be ignored. The device information contents (name and FCM registration token) can be changed using a DeviceInformationChange.

The DeviceInformation data is stored in nevisIDM as generic credentials. For each account registered, a generic credential will be created in nevisIDM containing the device information. These generic credentials are named dispatch targets in the nevisFIDO terminology.

The following example creates a DeviceInformation using a phone description (that can be provided by the end user, since this is used for the end user to identify the mobile device) and a Firebase registration token:

DeviceInformation createDeviceInformation(
  String phoneDescription,
  String firebaseRegistrationToken,
) {
  return DeviceInformation(
    name: phoneDescription,
    fcmRegistrationToken: firebaseRegistrationToken,
  );
}

See:

Constructors

DeviceInformation({required String name, String? fcmRegistrationToken})
Default constructor for DeviceInformation.
factory
DeviceInformation.fromJson(Map<String, dynamic> json)
Alternate constructor that creates a DeviceInformation from a json.
factory

Properties

deviceId → String
The identifier that is generated for the device during registration.
no setter
fcmRegistrationToken → String?
The Firebase Cloud Messaging registration token.
no setter
hashCode → int
The hash code for this object.
no setterinherited
idUsernamePairs → Set<IdUsernamePair>
The identifiers of the generic credentials containing the dispatch target information in nevisIDM and the associated username.
no setter
name → String
A user-friendly name to identify this device. The name can be modified using DeviceInformationChange.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

fromJson(Map<String, dynamic> json) → dynamic
Returns a value of the type you specify, deserialized from a JSON object.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Returns a JSON-encoded representation of the value you supply.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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