1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-17 08:43:21 +00:00

Added custom device info service for determining model and version (ios = major version, android = API level).

This commit is contained in:
Kyle Spearrin
2016-08-23 22:43:17 -04:00
parent e5f3be9669
commit 043a4122b4
16 changed files with 664 additions and 156 deletions

View File

@@ -0,0 +1,25 @@
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;
}
}
}
}