Cordova EmailComposer插件(Cordova EmailComposer plugin)
我正在尝试使用Cordova 5.0.0和JQueryMobile的EmailComposer插件。 我已经使用CLI安装了插件( 这里 )。 我正在使用Phonegap App进行测试。
我使用了推荐的语法:
$("#btSend").on('touchstart', function(event) { console.log('--> @send'); cordova.plugins.email.open({ to: 'max@mustermann.de', subject: 'Greetings', body: '<h1>Nice greetings from Leipzig</h1>'} ); return false; });
但是代码不起作用。 试图调试,我已经放在“onDeviceReady”事件处理程序下:
console.log('--> @1: '+ (window.cordova===undefined).toString() ); console.log('--> @2: '+ (cordova.plugins===undefined).toString() ); console.log('--> @3: '+ (cordova.plugins.email===undefined).toString() );
产出是:
--> @1: false --> @2: true nothings appears here
你能帮我找一下电子邮件插件无效的原因吗?
非常感谢!!
I'm trying to use EmailComposer plugin with Cordova 5.0.0 and JQueryMobile. I've installed the plugin (here) using CLI. I'm testing using Phonegap App.
I have used the recommended syntax:
$("#btSend").on('touchstart', function(event) { console.log('--> @send'); cordova.plugins.email.open({ to: 'max@mustermann.de', subject: 'Greetings', body: '<h1>Nice greetings from Leipzig</h1>'} ); return false; });
But the code is not working. Trying to debug, I've placed under the "onDeviceReady" event handler:
console.log('--> @1: '+ (window.cordova===undefined).toString() ); console.log('--> @2: '+ (cordova.plugins===undefined).toString() ); console.log('--> @3: '+ (cordova.plugins.email===undefined).toString() );
The outputs are:
--> @1: false --> @2: true nothings appears here
Could you help me to find why the email plugin is not working?
Many thanks!!
原文:https://stackoverflow.com/questions/30130545
最满意答案
您可以向PrintMe添加一个显式的运行处理程序,这将允许您在脚本中有两个不同的入口点。 两者都有争议。 我在这里设置了一个文件被传递给运行处理程序,并且一个列表被传递给open处理程序,但是如果你想要的话,你可以将一个列表传递给运行处理程序并重复你在open中执行的方式。
在RenameMe中:
if cmdPressed is true then #pass the file to the PrintMe droplet run script (load script file "path:to:PrintMe.app") with parameters (item i of the_Droppings) end if
在打印我:
on open the_droppings repeat with i from 1 to (count the_droppings) process(item i of the_droppings) end repeat end open on run the_file process(the_file) end run on process(the_file) // Code for printing files goes here end process
You can add an explicit run handler to PrintMe, which will allow you two different entry points into the script. Both of which take arguments. I've set it up here with one file being passed to the run handler, and a list being passed to the open handler, but if you wanted you could pass a list to the run handler and repeat the same way you do in open.
In RenameMe:
if cmdPressed is true then #pass the file to the PrintMe droplet run script (load script file "path:to:PrintMe.app") with parameters (item i of the_Droppings) end if
In Print Me:
on open the_droppings repeat with i from 1 to (count the_droppings) process(item i of the_droppings) end repeat end open on run the_file process(the_file) end run on process(the_file) // Code for printing files goes here end process
相关问答
更多-
查看API文档https://developers.digitalocean.com/documentation/v2/ 您应该能够看到Droplet的状态(请参阅Droplet部分)。 使用您的逻辑,您可以: 创建Droplet并将id存储在变量中 睡1分钟 使用id / v2 / drops / $ DROPLET_ID调用Droplet。 测试响应状态(表示Droplet实例状态的状态字符串。可以是“new”,“active”,“off”或“archive”。)。 如果status == new做某事 ...
-
将行处理程序中的行: doIt(thePath)更改为: my doIt(thePath) 。 出错的原因是你尝试在finder范围内使用你的处理程序,而finder并没有将它重新认识为它自己的东西。 因此,您必须在my的前面添加my ,因此可以解析处理程序。 Change the line: doIt(thePath) in the open handler into: my doIt(thePath). The reason for the error, is that you try to use y ...
-
您可以在curl http://169.254.169.254/metadata/v1/id中运行curl http://169.254.169.254/metadata/v1/id ,它将为您提供Droplet的ID。 如果要在shell脚本中使用它,可以执行以下操作: #!/bin/sh droplet_id=$(curl http://169.254.169.254/metadata/v1/id) echo "droplet id: $droplet_id" # use $droplet_id in ...
-
使用docker-machine创建DigitalOcean Droplet时出错(Error creating DigitalOcean droplet using docker-machine)[2023-08-30]
错误是: read udp 127.0.0.1:40376->127.0.1.1:53: i/o timeout 看起来它试图使用localhost作为名称服务器并且没有运行DNS服务器。 你的/etc/resolv.conf文件是什么样的? 解决此问题的两种方法:在本地机器上启动DNS服务器,或者更好的方法是修复该文件中的DNS服务器设置,并使用例如8.8.8.8作为名称服务器。 Not 100% sure but I solved the problem as following. I was deve ... -
我说你已经改变了除Apache服务的“允许服务与桌面交互”复选框之外的所有内容。 I'd say you've changed everything except the "Allow service to interact with desktop" checkbox for the Apache service.
-
您可以向PrintMe添加一个显式的运行处理程序,这将允许您在脚本中有两个不同的入口点。 两者都有争议。 我在这里设置了一个文件被传递给运行处理程序,并且一个列表被传递给open处理程序,但是如果你想要的话,你可以将一个列表传递给运行处理程序并重复你在open中执行的方式。 在RenameMe中: if cmdPressed is true then #pass the file to the PrintMe droplet run script (load script fi ...
-
我无法提供有关rails + apache的体面教程,但我可以帮助nginx + rails +零停机时间。 通常,webserver apache , nginx充当代理Web服务器。 它们通过unix域套接字将用户的请求发送到作为单独进程运行的rails应用程序。 我已经编写了一个关于从头开始设置部署服务器的详细教程。 设置vps 保护vps + nginx 部署rails应用程序 希望能帮助到你 ! I can't help by providing a decent tutorial on rail ...
-
要使用Automator创建Droplet,请在Automator询问您要创建的内容时选择应用程序。 当您选择应用程序时,应用程序给出的描述如下: 应用程序是自行运行的工作流程。 删除到应用程序的任何文件或文件夹都将用作工作流的输入。 我认为这意味着只有删除的文件/目录才会传递给工作流程。 我测试了它,我可以确认它以这种方式工作。 To create a droplet with Automator, you select application, when Automator asks you what ...
-
您可以在digital ocean的网站上重置root密码。 此功能显示在Droplet的“Access”选项卡上。 您可以按照本文使用ssh-key访问您的Droplet https://www.digitalocean.com/community/tutorials/how-to-use-ssh-keys-with-putty-on-digitalocean-droplets-windows-users You can reset root password at digital ocean's web ...
-
如何在Digital Ocean Droplet上部署我的流星应用程序(How to deploy my meteor app on Digital Ocean Droplet)[2021-11-16]
我已经使用arunoda的解决方案部署到我的DO Droplet https://github.com/arunoda/meteor-up 在安装模块后的文档中,您将获得mup命令 您可以在此处找到有关如何部署的详细文档 https://meteorhacks.com/deploy-a-meteor-app-into-a-server-or-a-vm.html All the solution I found were not working well with Ubuntu 10.04. An easy ...