ERROR: Plugin 'EmailComposer' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml

孤者浪人 提交于 2019-12-14 03:57:16

问题


I am using Cordova 2.8.1 and am generated application using Terminal.

And i added EmailComposer.h & EmailComposer.m files in Plugins

and EmailComposer.js file in www.

<script type="text/javascript" charset="utf-8" src="EmailComposer.js"></script> 

added in index.html.

In plist file i added key: EmailComposer and value: EmailComposer in Plugins.

And finally in config.xml i added

<feature name="Plugin">
    <param name="ios-package" value="CDVPlugin"/>
</feature>

In button action am calling method

Cordova.exec(null, null, 'EmailComposer','showEmailComposer', ["emailID@gmail.com", "message"])

But am getting error as follows

ERROR: Plugin 'EmailComposer' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.

-[CDVCommandQueue executePending] [Line 116] FAILED pluginJSON = [
"INVALID",
"EmailComposer",
"showEmailComposer",
[
  "emailID@gmail.com",
  "message"
]
]

Any suggestions for this problem Thanks in advance.


回答1:


Try this in config.xml:

<feature name="EmailComposer">
      <param name="ios-package" value="EmailComposer"/>
</feature>

The first "EmailComposer" is the name of this plugin in JS side, and the second "EmailComposer" is the class name of this plugin in native(Objective-C) side .



来源:https://stackoverflow.com/questions/17566440/error-plugin-emailcomposer-not-found-or-is-not-a-cdvplugin-check-your-plugi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!