Month: August 2019

Pattern cannot match values of type ‘LABiometryType’ in ionic project

I’m getting the following errors while building my ionic 4 app, This error came from a cordova plugin called cordova-plugin-fingerprint-aio , After a long research i fixed this issue by modifying the code in the plugin core files.

File location: src/ios/Fingerprint.swift

Actual code ( Swift )

switch(authenticationContext.biometryType) {
    case .none:
        biometryType = "none";
    case .touchID:
        biometryType = "finger";
    case .faceID:
        biometryType = "face"

Modified code

switch(authenticationContext.biometryType) {
	case LABiometryType.none:
	    biometryType = "none";
	case LABiometryType.typeTouchID:
	    biometryType = "finger";
	case LABiometryType.typeFaceID:
	    biometryType = "face"

The changes fixed the issues and app is working fine. You must remove and add the ios platform again to reflect the changes

PS: I’m not a Swift programmer and i won’t say that the above solution is perfect

Typescript observable example


Recently, I wanted to use observable in one of my ionic 4 project, client wanted to show a progress bar during the file uploading process, So that i decided to use it and googled for the example, but unfortunately i did’t find any best Typescript observable example that fulfill my needs and i spent so much time to make it work as i expected, that why i’m writing this post to share a sample code for the same.

Code Samples

    testObservable() {
	var i = 0;
        return  new Observable<Upload>((observer) => {
		var int = setInterval(()=>{
			var data = {
				status: 'In progress',
				url: 'bbbb',
				percent: ( i / 10 )
				data.status= 'Completed';;
class Upload {
	public status: string;
	public url: string;
	public percent: number;
this.obsData$ = this.testObservable();
	(responseObj: any) => { // On next 
	(error:any) => console.log(error),
	() => { // On complete

HTML page

<p>{{ ( obsData$ | async )?.status}}</p>
<ion-progress-bar value="{{( obsData$ | async )?.percent }}"></ion-progress-bar>

You may contact me if you need any further help
Sijo Vijayan