Phonegap-plugin-barcodescanner not working correctly with ionic v5

# Bug Report
Ionic version:
5.4.13
Current behavior:
Console error :
Exception calling native with command :: BarcodeScanner :: encode ::exception=TypeError: success is not a function .

Expected behavior:
Return the encoded image

Steps to reproduce:
add this in code

this.barcodeScanner.encode(this.barcodeScanner.Encode.TEXT_TYPE,this.encodeData).then((encodedData) => {

       console.log(encodedData);
       this.encodedData = encodedData;

   }, (err) => {
       console.log("Error occured : " + err);
   }); 

devDependencies

@angular-devkit/build-angular”: “~0.803.20”,
@angular/cli”: “~8.3.23”,
@angular/compiler”: “~8.2.14”,
@angular/compiler-cli”: “~8.2.14”,
@angular/language-service”: “~8.2.14”,
@ionic/angular-toolkit”: “^2.1.1”,
@types/jasmine”: “~3.3.8”,
@types/jasminewd2”: “~2.0.3”,
@types/node”: “~8.9.4”,
“codelyzer”: “^5.0.0”,
“cordova-plugin-device”: “^2.0.2”,
“cordova-plugin-ionic-keyboard”: “^2.2.0”,
“cordova-plugin-ionic-webview”: “^4.1.3”,
“cordova-plugin-splashscreen”: “^5.0.2”,
“cordova-plugin-statusbar”: “^2.4.2”,
“cordova-plugin-whitelist”: “^1.3.3”,
“jasmine-core”: “~3.4.0”,
“jasmine-spec-reporter”: “~4.2.1”,
“karma”: “~4.1.0”,
“karma-chrome-launcher”: “~2.2.0”,
“karma-coverage-istanbul-reporter”: “~2.0.1”,
“karma-jasmine”: “~2.0.1”,
“karma-jasmine-html-reporter”: “^1.4.0”,
“protractor”: “~5.4.0”,
“ts-node”: “~7.0.0”,
“tslint”: “~5.15.0”,
“typescript”: “~3.4.3”