当前位置: 代码迷 >> Web前端 >> BlackBerry WebWorks API监控手机下进来的邮件
  详细解决方案

BlackBerry WebWorks API监控手机下进来的邮件

热度:863   发布时间:2012-11-07 09:56:10.0
BlackBerry WebWorks API监控手机上进来的邮件
下载 blackberry-WebWorks-Community-APIs
https://github.com/blackberry/WebWorks-Community-APIs


电脑上已经安装了BlackBerry WebWorks SDK for smartphone

安装路径,比如C:\RIM\BlackBerry WebWorks SDK 2.3.1.5

在其子目录ext下,创建子目录webworks.message.email


解压缩blackberry-WebWorks-Community-APIs  zip文件, 拷贝其中的\Smartphone\EmailListener下面所有文件到

BlackBerry WebWorks SDK 2.3.1.5\ext\webworks.message.email


BlackBerry Webworks应用的config.xml应包括

<feature id="webworks.message.email" />
<feature id="blackberry.message" />
<feature id="blackberry.identity" />
<feature id="blackberry.find" />


message的常用字段如下,更多字段见BlackBerry WebWorks SDK 2.3.1.5\ext\blackberry.messaging\blackberry\messaging\message\MessageObject.java源代码
message.from
message.toRecipients
message.subject
message.body


例子代码:

    <html>
      <head>
        <meta name="viewport" id="viewport" content="height=device-height,width=device-width,user-scalable=no" />
        <script type="text/javascript" >

				webworks.message.email.startListening("", displayMessage);

				function displayMessage(servicename, msgObject){		
					alert("Message recevied from listener for service: " + servicename);					
						document.getElementById("main_screen_container").innerHTML += "<br /> Message recevied from listener for service: " + servicename;
						document.getElementById("main_screen_container").innerHTML += "<br />msgObject.from = " +  msgObject.from;
						document.getElementById("main_screen_container").innerHTML += "<br />msgObject.subject = " +  msgObject.subject;
						//check out the API for more Message Object properties there are tons
				}	
		 
        </script>
      </head>
      <body >
    		<div id="main_screen_container"></div>
      </body>
    </html>



s

  相关解决方案