mirror of
https://github.com/bitwarden/mobile.git
synced 2024-12-28 17:18:23 +01:00
detect nfc enabled
This commit is contained in:
parent
cf41b524b0
commit
45c5801538
@ -1,6 +1,6 @@
|
||||
using Android.App;
|
||||
using Android.Nfc;
|
||||
using Android.OS;
|
||||
using Android.Util;
|
||||
using Bit.App.Abstractions;
|
||||
|
||||
namespace Bit.Android.Services
|
||||
@ -42,5 +42,14 @@ namespace Bit.Android.Services
|
||||
return 1f;
|
||||
}
|
||||
}
|
||||
public bool NfcEnabled
|
||||
{
|
||||
get
|
||||
{
|
||||
var manager = (NfcManager)Application.Context.GetSystemService("nfc");
|
||||
var adapter = manager.DefaultAdapter;
|
||||
return adapter != null && adapter.IsEnabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,5 +5,6 @@
|
||||
string Model { get; }
|
||||
int Version { get; }
|
||||
float Scale { get; }
|
||||
bool NfcEnabled { get; }
|
||||
}
|
||||
}
|
||||
|
@ -22,5 +22,6 @@ namespace Bit.iOS.Core.Services
|
||||
}
|
||||
}
|
||||
public float Scale => (float)UIScreen.MainScreen.Scale;
|
||||
public bool NfcEnabled => false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user