Custom Device Data
Custom device data consists of key-value pairs associated with a device. Use it to identify devices and add useful context such as an internal user ID, account plan, or application state.
The latest values appear under Custom Device Data on the device screen in the Bugfender Dashboard, where you can use them to search and filter devices.
Set custom device data after initializing Bugfender. Keys can contain up to 128 bytes and string values up to 192 bytes; longer values are truncated. Supported value types are strings, booleans, integers, and floating-point numbers, although the methods available vary by SDK.
Examples
Android (Java)
Bugfender.setDeviceString("user.id", "user-1234");
Bugfender.setDeviceInteger("user.photo_width", 600);
Bugfender.setDeviceBoolean("user.is_logged_in", true);
Bugfender.setDeviceFloat("user.children", 3.0f);
Bugfender.removeDeviceKey("user.children");
See also: Android (Java) — Device associated data.
Android (Kotlin)
Bugfender.setDeviceString("user.id", "user-1234")
Bugfender.setDeviceInteger("user.photo_width", 600)
Bugfender.setDeviceBoolean("user.is_logged_in", true)
Bugfender.setDeviceFloat("user.children", 3.0f)
Bugfender.removeDeviceKey("user.children")
See also: Android (Kotlin) — Device associated data.
iOS (Swift)
Bugfender.setDeviceString("user-1234", forKey: "user.id")
Bugfender.setDeviceInteger(600, forKey: "user.photo_width")
Bugfender.setDeviceBOOL(true, forKey: "user.is_logged_in")
Bugfender.setDeviceDouble(3.0, forKey: "user.children")
Bugfender.removeDeviceKey("user.children")
See also: iOS (Swift) — Device associated data.
iOS (Objective-C)
[Bugfender setDeviceString:@"user-1234" forKey:@"user.id"];
[Bugfender setDeviceInteger:600 forKey:@"user.photo_width"];
[Bugfender setDeviceBOOL:YES forKey:@"user.is_logged_in"];
[Bugfender setDeviceDouble:3.0 forKey:@"user.children"];
[Bugfender removeDeviceKey:@"user.children"];
See also: iOS (Objective-C) — Device associated data.
JavaScript, React Native, Capacitor / Ionic, and Cordova
These SDKs expose the same setDeviceKey and removeDeviceKey interface:
Bugfender.setDeviceKey('user.id', 'user-1234');
Bugfender.setDeviceKey('user.photo_width', 600);
Bugfender.setDeviceKey('user.is_logged_in', true);
Bugfender.setDeviceKey('user.children', 3.0);
Bugfender.removeDeviceKey('user.children');
See the platform-specific instructions:
- JavaScript on browsers — Device associated data
- React Native — Set Device Data
- Capacitor / Ionic — Device associated data
- Cordova — Device associated data
Flutter
FlutterBugfender.setDeviceString("user.id", "user-1234");
FlutterBugfender.setDeviceInt("user.photo_width", 600);
FlutterBugfender.setDeviceBool("user.is_logged_in", true);
FlutterBugfender.setDeviceFloat("user.children", 3.0);
FlutterBugfender.removeDeviceKey("user.children");
See also: Flutter — Set Device Data.
Unity
The Unity SDK currently supports string values:
Bugfender.SetDeviceString("user.id", "user-1234");
Bugfender.SetDeviceString("user.plan", "premium");
Bugfender.RemoveDeviceKey("user.plan");
See also: Unity — Set Device Data.
.NET MAUI
var bugfender = BugfenderBinding.Instance;
bugfender.SetDeviceString("user.id", "user-1234");
bugfender.SetDeviceInteger("user.photo_width", 600);
bugfender.SetDeviceFloat("user.children", 3.0f);
bugfender.RemoveDeviceKey("user.children");
See also: .NET MAUI — Set Device Data.
Tips
- Prefer stable, non-sensitive identifiers such as an internal user ID.
- Use consistent key names such as
user.idoraccount.plan; avoid creating multiple names for the same value. - Update or remove user-specific keys when the signed-in user changes.
- Do not store secrets such as passwords, authentication tokens, or payment data. Review your privacy requirements before sending personal data.
removeDeviceKeyremoves a key from the device's current custom data. It does not retroactively erase historical data that Bugfender has already retained.