私はこの質問に対する答えを高低で探してきました。PhoneGap 用の EmailComposer プラグインをダウンロードして、正常にインストールしました。[メール] ボタンをクリックすると、メール フィールドが問題なく表示されます。問題は、「To:」フィールドと「Subject」フィールドに事前入力しようとしていることです。さまざまな投稿 (主に StackOverflow で) を検索しましたが、同様の投稿をいくつか見ましたが、まったく同じ問題や実際の解決策はありません:
私が試した投稿: PhoneGap Email Composer Plugin 電話ギャップ jQuery モバイルを使用して iphone でメール コンポーザー プラグインを使用してメールを送信する方法
私が見つけることができた最も近いものはここにあります: https://groups.google.com/forum/#!searchin/phonegap/EmailComposer/phonegap/ItUj30UZnig/XTaBK7B8ahsJ
しかし、私はそこでの解決策に何の運もありませんでした。
上記のように。私がやろうとしているのは、「To:」と「Subject:」フィールドを事前入力することだけです。含まれている EmailComposer.js ドキュメントは次のようになります。
// window.plugins.emailComposer
function EmailComposer() {
this.resultCallback = null; // Function
}
EmailComposer.ComposeResultType = {
Cancelled:0,
Saved:1,
Sent:2,
Failed:3,
NotSent:4
}
// showEmailComposer : all args optional
EmailComposer.prototype.showEmailComposer = function(subject,body,toRecipients,ccRecipients,bccRecipients,bIsHTML) {
var args = {};
if(toRecipients)
args.toRecipients = toRecipients;
if(ccRecipients)
args.ccRecipients = ccRecipients;
if(bccRecipients)
args.bccRecipients = bccRecipients;
if(subject)
args.subject = subject;
if(body)
args.body = body;
if(bIsHTML)
args.bIsHTML = bIsHTML;
cordova.exec(null, null, "EmailComposer", "showEmailComposer", [args]);
}
// this will be forever known as the orch-func -jm
EmailComposer.prototype.showEmailComposerWithCB = function(cbFunction,subject,body,toRecipients,ccRecipients,bccRecipients,bIsHTML) {
alert("email showEmailComposerWithCB?");
this.resultCallback = cbFunction;
this.showEmailComposer.apply(this, [subject,body,toRecipients,ccRecipients,bccRecipients,bIsHTML]);
}
EmailComposer.prototype._didFinishWithResult = function(res) {
this.resultCallback(res);
}
cordova.addConstructor(
function() {
if(!window.plugins) {
window.plugins = {};
}
// shim to work in 1.5 and 1.6
if (!window.Cordova) {
window.Cordova = cordova;
};
//window.plugins.emailComposer.showEmailComposer(subject,body,toRecipients,ccRecipients,bccRecipients,bIsHTML)
window.plugins.emailComposer = new EmailComposer();
}
);
で始まる実際の行:
EmailComposer.prototype.showEmailComposer
実際に解雇されることはありません。一般に向けて、私はこれを持っています (これは有効な HTML ですが、投稿のためにいくつかのタグを削除しました:
<a onclick="cordova.exec(null, null, 'EmailComposer', 'showEmailComposer', [args]);">Send Email</a>
私はそれから持っています:
app.initialize();
var args;
ページが最初に読み込まれたときに発生します。
ここで私が間違っていることについてのアイデアはありますか?