Skip to content

Use correct Device Model Identifier #239

@ABausG

Description

@ABausG

Describe the bug

The Launchdarkly Website states that Device / Model Context is providing a value like:
iPhone10,3

for device model.

model Model of the device. Pixel 6 Pro, iPhone, iPhone10,3, iPad

However this is not true for the Flutter SDK as that will always just report "iPhone" as it is using info.model from device_info_plus

final info = await DeviceInfoPlugin().iosInfo;
return DeviceInfo(model: info.model, manufacturer: 'Apple');

https://pub.dev/documentation/device_info_plus/latest/device_info_plus/IosDeviceInfo/model.html
https://developer.apple.com/documentation/uikit/uidevice/model

Instead the utsname.machine should be used for this:
https://pub.dev/documentation/device_info_plus/latest/device_info_plus/IosUtsname/machine.html

To reproduce
Use the SDK on an iPhone
Observer that the device.model is just "iPhone"

Expected behavior
device.model should include the actual device type
alternatively add a new field

Important

Otherwise targetting iPhones by Model is not possible

Logs

SDK version
4.14.0

OS/platform
iOS

Additional context
See the output from DeviceInfoPlus

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpackage: flutter_client_sdkIssues that affect the flutter client SDK.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions