mirror of
https://github.com/bitwarden/mobile
synced 2025-12-30 07:03:48 +00:00
add type to deviceinfo to avoid using XF
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
{
|
||||
public interface IDeviceInfoService
|
||||
{
|
||||
string Type { get; }
|
||||
string Model { get; }
|
||||
int Version { get; }
|
||||
float Scale { get; }
|
||||
|
||||
@@ -23,9 +23,14 @@ namespace Bit.App.Utilities
|
||||
}
|
||||
|
||||
public static T OnPlatform<T>(T iOS = default(T), T Android = default(T),
|
||||
T WinPhone = default(T), T Windows = default(T))
|
||||
T WinPhone = default(T), T Windows = default(T), string platform = null)
|
||||
{
|
||||
switch(Device.RuntimePlatform)
|
||||
if(platform == null)
|
||||
{
|
||||
platform = Device.RuntimePlatform;
|
||||
}
|
||||
|
||||
switch(platform)
|
||||
{
|
||||
case Device.iOS:
|
||||
return iOS;
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace Bit.App
|
||||
{
|
||||
var tokenService = Resolver.Resolve<ITokenService>();
|
||||
var appIdService = Resolver.Resolve<IAppIdService>();
|
||||
var deviceInfoService = Resolver.Resolve<IDeviceInfoService>();
|
||||
|
||||
if(!string.IsNullOrWhiteSpace(tokenService.Token))
|
||||
{
|
||||
@@ -25,7 +26,7 @@ namespace Bit.App
|
||||
}
|
||||
|
||||
Headers.Add("Device-Type", ((int)Helpers.OnPlatform(iOS: DeviceType.iOS,
|
||||
Android: DeviceType.Android, Windows: DeviceType.UWP)).ToString());
|
||||
Android: DeviceType.Android, Windows: DeviceType.UWP, platform: deviceInfoService.Type)).ToString());
|
||||
}
|
||||
|
||||
public TokenHttpRequestMessage(object requestObject)
|
||||
|
||||
Reference in New Issue
Block a user