Skip to content

CrossNFC.Current.StartListening() on Content Page load not working - .NET Maui Android App. #149

@mach-9

Description

@mach-9

Description
I would like to automatically start listening to NFC tags when my page is accessed, not activating it by pressing a button. I've tried different measures, in the constructor of the page, but OnResume must be fired after OnCreate. Tried to call it in the constructor, but it fails.

My app consists of 3 pages, login, list and a detail page where I would like to read the NFC tag. Also using navigation to go between pages, ex.:
await Navigation.PushModalAsync(new ScanBarcodeView(_UserService, _TestService));

I'm using DI for all the service layers, tried also to DI it into my page, but to no avail.

The logic for the page is, start listening for tags, read and then write to the tag, close listener and redirect to previous page.

Basic Information

  • Version with issue: Current version Plugin.NFC 0.1.26
  • Last known good version: U/K
  • IDE: VS 2022 17.8
  • Platform Target Frameworks:
  • Android: 13.2.2.0
  • Nuget Packages: Plugin.NFC 0.1.26
  • Affected Devices: Samsung S10

Any help is much appreciated.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions