smstuebe / xamarin-fingerprint

Xamarin and MvvMCross plugin for authenticate a user via fingerprint sensor
Microsoft Public License
494 stars 118 forks source link

MvvMCross current activity not registered #64

Closed xamarin7100 closed 2 years ago

xamarin7100 commented 7 years ago

To help us fix your issue, please provide the information in the below template. If something causes a crash, provide as much information as you can gather. Just imagine: we do not know what you are doing!

Note: There is often little we can do without a minimal reproducible sample of the issue, so please provide that in a standalone git repository and link it here.

Steps to reproduce

  1. Install MvvmCross Fingerprint plugin.

  2. Create a event to call the lines of code as Example:

var fpService = Mvx.Resolve<IFingerprint>();
var result = await fpService.AuthenticateAsync("Use your fingerprint to log in");
  1. fpService always throw a NULL value which make the 2nd line above not to execute.

Expected behavior

The line below should be called and ask to enter the fingerprint var result = await fpService.AuthenticateAsync("Use your fingerprint to log in");

Actual behavior

The line of code is skipped.

Crashlog

If something causes an exception paste full stack trace + Exception here

Configuration

Version of the Plugin: 1.4.3

Platform: Android API 25, .net Framework 4.5

Device: samsung S7

smsissuechecker commented 7 years ago

Hi @xamarin7100,

I'm the friendly issue checker. Thanks for using the issue template :star2: I appreciate it very much. I'm sure, the maintainers of this repository will answer, soon.

smstuebe commented 7 years ago

Wich version of MvvmCross are you using? Have you installed the plugin to all your projects? Core/iOS/Android? Do the bootstrap files exist in you Android/iOS projects?

xamarin7100 commented 7 years ago

Hi, thanks for replying. Wich version of MvvmCross are you using? v1.4.3 Andrioid Have you installed the plugin to all your projects? Core/iOS/Android? Yes, installed to all projects Do the bootstrap files exist in you Android/iOS projects? Yes, the bootstrap folder was created on Andrioid, but not on IOS.

smstuebe commented 7 years ago

MvvMCross 1.4.3? Can't be. The Plugin only supports MvvMCross > 4. Can you debug into the Bootstrap files, if everything gets called correctly?

xamarin7100 commented 7 years ago

The MvvmCross.Platform is v 4.0.0.0 The MvvmCross.Plugins.Fingerprint v 1.4.3.0 The Plugin.Fingerprint.Abstractions v 1.4.3.0

In the Android Bootstrap folder, there is a FingerprintPluginBootstrap.cs which has the code below: using MvvmCross.Platform.Plugins;

namespace Fingerprint_test.Droid.Bootstrap { public class FingerprintPluginBootstrap : MvxPluginBootstrapAction { } }

I'm not able to put break point there. And I don't think it got called.

One correction, the bootstrap folder is on IOS too. I used your sample project and I debugged the method below:

private async void OnAuthenticate(object sender, EventArgs e) { lblStatus.Text = ""; var fpService = Mvx.Resolve(); var result = await fpService.AuthenticateAsync("Prove you have fingers!", _cancel.Token);

        await SetResultAsync(result);
    }

On the line var fpService = Mvx.Resolve();, it just broke. The error is "An unhandled exception occured." The application is in break mode

smstuebe commented 7 years ago

Wich exception?

xamarin7100 commented 7 years ago

It didn't listed. I checked the value of fpService which is NULL.

xamarin7100 commented 7 years ago

Can you give us a working sample on MvvmCross?

smstuebe commented 7 years ago

Can you provide me a minimum example project that has your issue? Just create a github repository and push it there. I don't wan't you actual app, but something I can investigate!

xamarin7100 commented 7 years ago

Hi, I created a repository with a sample. Thanks https://github.com/xamarin7100/fingerprint_test.git

xamarin7100 commented 7 years ago

With the new version, it's working well now. thanks

dzeping96 commented 7 years ago

@smstuebe @xamarin7100 Hi, I still meet this issues with v1.4.4.0, I am using the sample repository provide by xamarin7100. Do you guys have any idea? Thanks