Tuesday, September 20, 2016

ERROR TypeError: UIApplication.sharedApplication is not a function.

ERROR TypeError: UIApplication.sharedApplication is not a function. (In 'UIApplication.sharedApplication()', 'UIApplication.sharedApplication' is an instance of UIApplication)


In your Javascript remove () , change from :

QRCodeReaderDelegateImpl.prototype.readerDidCancel = function (reader) {
  UIApplication.sharedApplication().keyWindow.rootViewController.dismissViewControllerAnimatedCompletion(true, null);  this._callback(reader);};QRCodeReaderDelegateImpl.prototype.readerDidScanResultForType = function (reader, text, type) {
  UIApplication.sharedApplication().keyWindow.rootViewController.dismissViewControllerAnimatedCompletion(true, null);  this._callback(reader, text, type);};


To:

QRCodeReaderDelegateImpl.prototype.readerDidCancel = function (reader) {
  UIApplication.sharedApplication.keyWindow.rootViewController.dismissViewControllerAnimatedCompletion(true, null);  this._callback(reader);};QRCodeReaderDelegateImpl.prototype.readerDidScanResultForType = function (reader, text, type) {
  UIApplication.sharedApplication.keyWindow.rootViewController.dismissViewControllerAnimatedCompletion(true, null);  this._callback(reader, text, type);};