【问题标题】:"FAILED pluginJSON" Error while Calling EmailComposerwithattachments PlugIn in Phonegap-2.3.0在 Phonegap-2.3.0 中调用 EmailComposerwithattachments 插件时出现“FAILED pluginJSON”错误
【发布时间】:2013-02-21 09:18:25
【问题描述】:

您好,我正在使用 phonegap 插件中的 EmailcomposerWithAttachments 插件。我正在使用 Phonegap-2.3.0 和 ios6 Simulator 和最新的 Xcode。

我已将.m、.h 文件放在项目的Plugins 文件夹中,将Js 文件放在WWW 文件夹中,并使用

调用插件
window.plugins.emailComposer.showEmailComposer("Look at this photo","Take a look at <b>this<b/>:",["the.das@gmail.com", "dasthe@gmail.com"],[],[],true,[]);

readme.md 文件中给出的 js 代码。 https://github.com/phonegap/phonegap-plugins/tree/master/iOS/EmailComposerWithAttachments

当我运行它时,我在日志中遇到错误。

-[CDVCommandQueue executePending] [Line 103] FAILED pluginJSON = ["INVALID","EmailComposer","showEmailComposer",[{"subject":"Look at this photo","bIsHTML":true,"ccRecipients":[],"attachments":[],"bccRecipients":[],"toRecipients":["the.das@gmail.com","dasthe@gmail.com"],"body":"Take a look at <b>this<b/>:"}]]

请让我知道我做错了什么。

在config.xml文件&lt;plugin name="EmailComposer" value="EmailComposer" /&gt;我在plugIn中添加了这个

谢谢。

【问题讨论】:

    标签: xcode cordova ios6 phonegap-plugins


    【解决方案1】:

    您的插件似乎已正确添加,但插件文件中出现了一些错误。我认为您可以在 xcode 中创建另一个项目并编译以检查插件中是否存在错误。

    【讨论】:

      【解决方案2】:

      尝试像这样使用“”而不是[]

      window.plugins.emailComposer.showEmailComposer(
      "Look at this photo", // subject
      "Take a look at <b>this<b/>:", // body
      "the.das@gmail.com,dasthe@gmail.com", // toRecipients
      "", // toRecipients
      "", // bccRecipients
      true, // bIsHTML
      );
      

      在代码中,我们希望字符串由 @","

      分隔
      ...
      [picker setToRecipients:[ toRecipientsString componentsSeparatedByString:@","]];
      ...
      

      希望对你有帮助

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2014-01-05
        • 2016-02-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多