mirror of
https://github.com/bitwarden/android.git
synced 2024-11-01 15:45:42 +03:00
26 lines
651 B
C#
26 lines
651 B
C#
|
using Bit.App.Abstractions;
|
|||
|
using UIKit;
|
|||
|
|
|||
|
namespace Bit.iOS.Core.Services
|
|||
|
{
|
|||
|
public class DeviceInfoService : IDeviceInfoService
|
|||
|
{
|
|||
|
public string Model => UIDevice.CurrentDevice.Model;
|
|||
|
public int Version
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
int version;
|
|||
|
var versionParts = UIDevice.CurrentDevice.SystemVersion.Split('.');
|
|||
|
if(versionParts.Length > 0 && int.TryParse(versionParts[0], out version))
|
|||
|
{
|
|||
|
return version;
|
|||
|
}
|
|||
|
|
|||
|
// unable to determine version
|
|||
|
return -1;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|