NFC Test vol 1.

This commit is contained in:
2025-01-24 14:37:21 +01:00
parent 0d44cd48fb
commit e74df61ca0
9 changed files with 183 additions and 1 deletions
@@ -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);
}
}
}