Search code examples
phonegap-pluginscordova-plugins

How to configure plugin "cordova-plugin-screen-orientation" in config.xml


cordova plugin add cordova-plugin-screen-orientation

After I fetched the plugin cordova-plugin-screen-orientation with the line above I looked inside the config.xml and I couldn't find a similar line like below for the plugin.

<gap:plugin name="org.apache.cordova.media-capture" />

I already tried

  • guessing the plugin id/name (PhoneGap Build kept saying the plugin is unsupported):
    <gap:plugin name="org.apache.cordova.screen-orientation" />
    <gap:plugin name="cordova-plugin-screen-orientation" />

The last line is the plugin id/name from the plugins plugin.xml.

<gap:plugin name="cordova-plugin-screen-orientation" src="npm" />`

Can someone tell me the plugin id/name or how to configure the plugin in the config.xml?


Solution

  • The solution is replacing src="npm" with source="npm".

    <gap:plugin name="cordova-plugin-screen-orientation" source="npm" version="1.4.0" />
    

    Credits go to https://github.com/bau720123 for giving me the solution in the issue I created on GitHub. The issue is deleted so I can't post a link to it.

    For more info on how to configure a plugin in the config.xml go here: http://docs.phonegap.com/phonegap-build/configuring/plugins/