当使用cordova-plugin-android-fingerprint-auth时,MobileFirst 7.1应



我在我的应用程序中使用cordova指纹认证插件,但应用程序崩溃并显示logcat中的以下错误。

11-14 11:12:47.671: W/PluginManager(30565): THREAD WARNING: exec()调用FingerprintAuth。身份验证阻塞主线程33ms。插件应该使用cordoainterface . getthreadpool()。

11-14 11:12:47.712: D/FingerprintAuthDialog(30565): disableBackup:false 11-14 11:12:47.713: W/ResourceType(30565): No package identifier获取资源号0x00000000 11-14的值时11:12:47.713: D/AndroidRuntime(30565): closing down VM 11-14 .日志示例11:12:47.716: E/AndroidRuntime(30565): FATAL EXCEPTION: main 11-1411:12:47.716: E/AndroidRuntime(30565): Process: com。指纹,PID:30565 11-14 11:12:47.716: E/AndroidRuntime(30565):android.content.res。$NotFoundException:资源ID #0x011-14 11:12:47.716: E/AndroidRuntime(30565): atandroid.content.res.Resources.getValue (11 - 14 Resources.java: 1351)11:12:47.716: E/AndroidRuntime(30565): atandroid.content.res.Resources.loadXmlResourceParser (Resources.java: 2777)11-14 11:12:47.716: E/AndroidRuntime(30565): atandroid.content.res.Resources.getLayout (11 - 14 Resources.java: 1165)11:12:47.716: E/AndroidRuntime(30565): atandroid.view.LayoutInflater.inflate (11 - 14 LayoutInflater.java: 421)11:12:47.716: E/AndroidRuntime(30565): atcom.fingerPrint.FingerprintAuthenticationDialogFragment.onCreateView (FingerprintAuthenticationDialogFragment.java: 87)11-14 11:12:47.716: E/AndroidRuntime(30565): atandroid.app.Fragment.performCreateView (11 - 14 Fragment.java: 2220)11:12:47.716: E/AndroidRuntime(30565): atandroid.app.FragmentManagerImpl.moveToState (FragmentManager.java: 973)11-14 11:12:47.716: E/AndroidRuntime(30565): atandroid.app.FragmentManagerImpl.moveToState (FragmentManager.java: 1148)11-14 11:12:47.716: E/AndroidRuntime(30565): atandroid.app.BackStackRecord.run (11 - 14 BackStackRecord.java: 793)11:12:47.716: E/AndroidRuntime(30565): atandroid.app.FragmentManagerImpl.execPendingActions (FragmentManager.java: 1537)11-14 11:12:47.716: E/AndroidRuntime(30565): atandroid.app.FragmentManagerImpl 1.美元(11 - 14 FragmentManager.java: 482)运行11:12:47.716: E/AndroidRuntime(30565): atandroid.os.Handler.handleCallback (11 - 14 Handler.java: 746)11:12:47.716: E/AndroidRuntime(30565): atandroid.os.Handler.dispatchMessage (11 - 14 Handler.java: 95)11:12:47.716: E/AndroidRuntime(30565): atandroid.os. loop .loop(loop .java:148) 11-14 11:12:47.716:E/AndroidRuntime (30565):android.app.ActivityThread.main (11 - 14 ActivityThread.java: 5443)11:12:47.716: E/AndroidRuntime(30565): atjava.lang.reflect.Method。调用(本地方法)11:12:47.716:E/AndroidRuntime (30565):com.android.internal.os.ZygoteInit MethodAndArgsCaller.run美元(ZygoteInit.java: 728)11-14 11:12:47.716: E/AndroidRuntime(30565): atcom.android.internal.os.ZygoteInit.main (11 - 14 ZygoteInit.java: 618)11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):记录器UncaughtExceptionHandler美元。log .java中的uncaughtException:471未捕获的异常11-14 11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):android.content.res。$NotFoundException:资源ID #0x011 - 14 11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):android.content.res.Resources.getValue (11 - 14 Resources.java: 1351)11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):android.content.res.Resources.loadXmlResourceParser (Resources.java: 2777)11 - 14 11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):android.content.res.Resources.getLayout (11 - 14 Resources.java: 1165)11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):android.view.LayoutInflater.inflate (11 - 14 LayoutInflater.java: 421)11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):com.fingerPrint.FingerprintAuthenticationDialogFragment.onCreateView (FingerprintAuthenticationDialogFragment.java: 87)11 - 14 11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):android.app.Fragment.performCreateView (11 - 14 Fragment.java: 2220)11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):android.app.FragmentManagerImpl.moveToState (FragmentManager.java: 973)11 - 14 11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):android.app.FragmentManagerImpl.moveToState (FragmentManager.java: 1148)11 - 14 11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):android.app.BackStackRecord.run (11 - 14 BackStackRecord.java: 793)11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):android.app.FragmentManagerImpl.execPendingActions (FragmentManager.java: 1537)11 - 14 11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):android.app.FragmentManagerImpl 1.美元(11 - 14 FragmentManager.java: 482)运行11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):android.os.Handler.handleCallback (11 - 14 Handler.java: 746)11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):android.os.Handler.dispatchMessage (11 - 14 Handler.java: 95)11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):android.os. loop .loop(loop .java:148) 11-14 11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):android.app.ActivityThread.main (11 - 14 ActivityThread.java: 5443)11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):java.lang.reflect.Method。调用(本地方法)11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):com.android.internal.os.ZygoteInit MethodAndArgsCaller.run美元(ZygoteInit.java: 728)11 - 14 11:12:47.718:E/com.worklight.common.Logger UncaughtExceptionHandler美元(30565):com.android.internal.os.ZygoteInit.main (11 - 14 ZygoteInit.java: 618)11:12:47.723: D/com.worklight.wlclient.api.WLLifecycleHelper (30565):WLLifecycleHelper。logAppSession in WLLifecycleHelper.java:109:: trying在没有起始时间戳的情况下记录应用程序崩溃

步骤是:

  1. 添加插件FingerprintAuth.javaFingerprintAuthenticationDialogFragment.java,FingerprintUiHelper.javaandroid/src/com/文件夹
  2. 添加到config.xml

    <feature name="FingerprintAuth">
    <param name="android-package"  value="com.fingerPrint.FingerprintAuth"/>
    </feature> 
    
  3. 添加FingerprintAuth.js常见/js文件夹

  4. 每次在cordova_plugins.js中添加以下内容在部署到设备

    之前
    { "id": "FingerprintAuth", "file": "../js/FingerprintAuth.js", "clobbers": [ "FingerprintAuth" ] } 
    

5。要检查指纹认证,请在main.js文件

中添加以下代码
FingerprintAuth.isAvailable(function(result) {
if (result.isAvailable) {
var client_id = "Your client ID";
var client_secret = "A very secret client secret (once per device)";
if(result.hasEnrolledFingerprints){
FingerprintAuth.show({
clientId: client_id,
clientSecret: client_secret
}, function (result) {
if (result.withFingerprint) {

alert("Authentication Success");

//$location.path("singin");
} else if (result.withPassword) {
alert("Authenticated with backup password");
}
}, function(error) {
console.log(error); // "Fingerprint authentication not available"
});
}else{
alert("Fingerprint auth available, but no fingerprint registered on the device");
}
}
}, function(message) {
alert("Cannot detect fingerprint device : "+ message);
});

我不确定这在Hybrid应用程序中是否有效。

但是请注意,根据插件页面,这个插件需要Android API级别23,这是最近才添加的。请首先确保升级到MobileFirst Platform Foundation 7.1的最新iFix

相关内容

  • 没有找到相关文章

最新更新