BlackBerry BES推送例子代码(php)

本文提供了一个基于PHP的RIM BES Push示例代码,该代码能够通过BES模拟器将数据推送到BlackBerry模拟器上的客户端程序ECLSampleclient。示例展示了如何设置cURL选项并发送POST请求。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

RIM提供的标准BES Push例子代码是基于Java/Domino/ASP的。没有php的官方例子代码。


这里给一个简单的php例子,是基于参考1简化而来的,可以通过BES emulator推送数据到BlackBerry Emulator上的客户端程序ECL Sample client(客户端代码参考最后两个链接)。


<html> <head> <title>Push Results</title> </head> <body> <?php // create a new cURL resource $ch = curl_init(); $data = 'NEXT_GROUP;Operations Team;NEW_CONTACT;Wang Bo 2011;Sr. Vice President, Operations;Office: 519 555-1111;Cell: 519 555-1222;Email: john.doe@email.xyz.com;BlackBerry: pin:1111111F;Prime Backup: John Flow;NEW_CONTACT;John Flow;Manager, Manufacturing Operations;Office: 519 555-2111;Cell: 519 555-2222;Email: john.flow@email.xyz.com;BlackBerry: pin:2222222F;Prime Backup: ;NEW_CONTACT;John Snow;Manager, Transportation Operations;Office: 519 555-3111;Cell: 519 555-3222;Email: john.snow@email.xyz.com;BlackBerry: pin:3333333F;Prime Backup: Julian;NEXT_GROUP;Support Team;NEW_CONTACT;Julian Migs;Team Planner;Office: 519 555-4111;Cell: 519 555-4222;Email: julian@email.xyz.com;Prime Backup: Ricky;NEW_CONTACT;Ricky Williams;Vice President, Plannning;Office: 519 555-5111;Cell: 519 555-5222;Email: ricky@email.xyz.com;NEW_CONTACT;Bubbles Devil;Feline Affairs Specialist;Office: 519 555-6111;Cell: 519 555-6222;Email: bubbles@email.xyz.com;NEW_CONTACT;Randy Whitt;Assistant Weekend Supervisor;Office: 519 555-7111;Cell: 519 555-7222;Email: randy@email.xyz.com;'; // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "http://localhost:8080/push?DESTINATION=2100000A&PORT=911&REQUESTURI=/"); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_USERAGENT, "BlackBerry Push Service SDK/1.0"); curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_VERBOSE, true); // grab URL and pass it to the browser curl_exec($ch); // close cURL resource, and free up system resources curl_close($ch); ?> </body> </html>


参考:

1)BES Push

http://supportforums.blackberry.com/t5/BlackBerry-Push-Development/Push-API-sample-code-needed/td-p/468267

2)BIS Push

http://us.blackberry.com/devjournals/resources/journals/jan_2005/push_me.jsp#Download_The_Source


3)ECL Java Push例子: What Is - Sample applications demonstrating BlackBerry push technology: Emergency Contact List

To push an Emergency Contact List toa BlackBerry smartphone, configure a Browser Channel push with the Emergency Contact List. A test application has been created and can be referred to in this article: DB-00442.


4)BES推送应用实例演示与分析


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值