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

Setting UIWebViewDelegate via updateWithInfo doesn't work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • cordova-ios 4.5.0
    • None
    • cordova-ios
    • None

    Description

      I have an existing Cordova app where I have manually modified MainViewController.m to add my own UIWebViewDelegate implementation – however, I'd like to do this the "right" way and use a plugin (so I can truly treat the platform code as a build artifact).

      From this guide, I see that I should be able to set my UIWebViewDelegate from my plugin code; however, this isn't working. My implementation is not getting called.

      In the code, it appears to be always using the CDVViewController as the delegate, no matter what is passed in.

      Is this a bug? Am I just doing it wrong? What's the correct way to do this?

      My scenario here is to trap the didFailLoadWithError event for some special handling (our Cordova app uses remote resources, and I want to allow a retry option if they don't load). This is working just fine when I modify the application source directly.

      (Also posted on SO: https://stackoverflow.com/questions/50162345/how-do-you-implement-uiwebviewdelegate-from-a-cordova-ios-plugin)

      Attachments

        Issue Links

          Activity

            People

              shazron Shazron Abdullah
              dpolivy Dan Polivy
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: