You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Filip Maj (JIRA)" <ji...@apache.org> on 2013/07/25 19:41:48 UTC

[jira] [Resolved] (CB-4396) unable to add ios plugin using plugman with js-module

     [ https://issues.apache.org/jira/browse/CB-4396?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Filip Maj resolved CB-4396.
---------------------------

    Resolution: Not A Problem

This is not a problem with plugman but rather with your .js file.

You are not exporting anything in your applicationPreferences.js. So when cordova.js goes to attach your .js module to a global, it is attaching {{undefined}}.

For an example of how to export an object from a .js module using {{<js-module>}}, see some of the core cordova plugins:

https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-battery-status.git;a=blob;f=www/battery.js;h=1b012ab419e88374147c386e14982a77400f664d;hb=HEAD


                
> unable to add ios plugin using plugman with js-module
> -----------------------------------------------------
>
>                 Key: CB-4396
>                 URL: https://issues.apache.org/jira/browse/CB-4396
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugman
>         Environment: cordova 2.9.5, macos 10.7.5
>            Reporter: Dan Moore
>            Assignee: Filip Maj
>
> I am unable to get an ios plugin to work with plugman when I use the js-module tag for identifying my javascript.
> You can see the plugin I'm trying to install here: https://github.com/8zrealestate/AppPreferences/tree/issue_1
> When I use the asset tag, everything works fine.
> To replicate the issue, you can create a sample project, and pull in the above branch of the plugin and add it.  Then add a couple of alerts to the recievedEvent function in index.js:
> alert("foo: "+applicationPreferences);
> alert("foo4: "+applicationPreferences.get);
> applicationPreferences is an object, but applicationPreferences.get is undefined.
> If you do the same thing with an 'asset' tag (and of course, adding it to the index.html and using the closure in applicationPreferences.js) then window.plugins.applicationPreferences works just fine.
> I thought the issue was the plugin.xml formatting, and I tried a number of different formats, as you can see here: https://github.com/8zrealestate/AppPreferences/commits/master/plugin.xml
> I have looked at the plugman plugin.xml spec, and I think I was setting up js-module correctly.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira