Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-11375

onReset method of CDVPlugin is never called

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 6.1.1, 6.2.0
    • None
    • cordova-ios

    Description

      CDVUIWebViewNavigationDelegate.webViewDidStartLoad gets called as it should. The line in that method:

      [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginResetNotification object:self.enginePlugin.webView]];
      

      seems to be an issue. The self.enginePlugin.webView reference calls into the webView method in CDVPlugin.m. There, the lines:

      if (self.webViewEngine != nil) {
          return self.webViewEngine.engineWebView;
      }
      

      should return the engineWebView, but instead it returns nil. I think that the issue is that CDVUIWebViewEngine extends CDVPlugin, but doesn't override the webView method. If I do override that getter in CDVUIWebViewEngine.m, with:

      - (UIView*)webView
      {
          if (self.engineWebView != nil) {
              return self.engineWebView;
          }
          
          return nil;
      }
      

      everything actually seems to get called correctly. I'm running Cordova 6.1.1 with Cordova iOS 4.1.1. It does not look like there are any changes since then that would affect this.

      Attachments

        Issue Links

          Activity

            People

              shazron Shazron Abdullah
              dalebeermann Dale Beermann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: