NFC Test vol 1.
This commit is contained in:
@@ -3,4 +3,6 @@
|
||||
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.NFC" />
|
||||
<uses-feature android:name="android.hardware.nfc" android:required="false" />
|
||||
</manifest>
|
||||
@@ -1,6 +1,8 @@
|
||||
using Android.App;
|
||||
using Android.Content;
|
||||
using Android.Content.PM;
|
||||
using Android.OS;
|
||||
using Plugin.NFC;
|
||||
|
||||
namespace WorkFlowCheck.MAUI
|
||||
{
|
||||
@@ -12,5 +14,26 @@ namespace WorkFlowCheck.MAUI
|
||||
SecureStorage.Default.Remove("WFCUser");
|
||||
base.OnDestroy();
|
||||
}
|
||||
protected override void OnCreate(Bundle savedInstanceState)
|
||||
{
|
||||
// Plugin NFC: Initialization before base.OnCreate(...) (Important on .NET MAUI)
|
||||
CrossNFC.Init(this);
|
||||
|
||||
base.OnCreate(savedInstanceState);
|
||||
}
|
||||
protected override void OnResume()
|
||||
{
|
||||
base.OnResume();
|
||||
|
||||
// Plugin NFC: Restart NFC listening on resume (needed for Android 10+)
|
||||
CrossNFC.OnResume();
|
||||
}
|
||||
protected override void OnNewIntent(Intent intent)
|
||||
{
|
||||
base.OnNewIntent(intent);
|
||||
|
||||
// Plugin NFC: Tag Discovery Interception
|
||||
CrossNFC.OnNewIntent(intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user