Skip to main content

Custom Device Data

Once your application is running on several devices, it is useful to know which device belongs to whom. You can associate information with a device as if it were a dictionary (for example email, user id, or plan name).

Those keys appear in the Bugfender Dashboard under Custom Device Data on the device screen, and you can search or filter devices by them.

Examples

Android (Java)

Bugfender.setDeviceString("user email", "john.smith@example.com");
Bugfender.setDeviceInteger("user.photo.image.width", 600);
Bugfender.setDeviceBoolean("user.is.logged", true);
Bugfender.setDeviceFloat("user.children", 3f);

Bugfender.removeDeviceKey("user.children");

See also: Android (Java) — Device associated data.

Android (Kotlin)

Bugfender.setDeviceKey("user.email", "john.smith@example.com")
Bugfender.setDeviceKey("user.is.logged", true)
Bugfender.removeDeviceKey("user.is.logged")

See also: Android (Kotlin) — Device associated data.

iOS (Swift)

Bugfender.setDeviceString("value", forKey: "key")

See also: iOS (Swift).

JavaScript / Web

Bugfender.setDeviceKey('key', 'value');
Bugfender.removeDeviceKey('key');

See also: JavaScript on browsers.

React Native / Ionic / Cordova

Bugfender.setDeviceKey('device.key.string', 'fake.string.value');
Bugfender.setDeviceKey('device.key.boolean', true);
Bugfender.setDeviceKey('device.key.float', 10.1);
Bugfender.setDeviceKey('device.key.integer', 102);

Bugfender.removeDeviceKey('device.key.integer');

See the platform guides under Hybrid development.

Tips

  • Prefer stable identifiers (user id, email) so support can find a device quickly.
  • Do not store secrets (passwords, tokens, full payment data) as device keys.
  • Removing a key with removeDeviceKey stops it from appearing on new sessions; historical logs keep prior associations where applicable.