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

Bug in dynamic loading of a plugin at CDVViewController's registerPlugin method

VotersWatch issueWatchersLinkUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.0
    • None
    • cordova-ios
    • None
    • iOS 6.1

    Description

      When loading a Cordova plugin later on in application run-time with the registerPlugin method, the plugin is not loaded correctly and the plugin cannot be used. This happens when the plugin is not defined in the config.xml. In our project we have a view which runs "widgets" that are downloaded from a server and these widgets use some Cordova plugins, but we don't know beforehand what plugins they use, so we don't want to add them to config.xml.

      Apparently registerPlugin method adds the plugin to pluginObjects but doesn't add it to the pluginsMap. So we have to do a hack and add the plugin to the pluginsMap ourselves after registering the plugin.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            shazron Shazron Abdullah
            jukka Jukka Zitting
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment