BlackBerry BES推送例子代碼(php)

來源:互聯網
上載者:User

RIM提供的標準BES Push例子代碼是基於Java/Domino/ASP的。沒有php的官方例子代碼。

2013年更新:BES 10/BDS 10針對BlackBerry 10手機的企業推送:

// create a new cURL resource$ch = curl_init();$data = 'subject=' . $entityData->get('ticket_title') . '&id=' . $entityData->get('ticket_no') . '&content=' . $entityData->get('description') . '&status=' . $entityData->get('ticketstatus') . '&author=Jiang Yang&createdtime=2013 04 18';// set URL and other appropriate optionscurl_setopt($ch, CURLOPT_URL, "http://bes101.acmehq.springworks.info:9080/push?DESTINATION=user02@acmehq.springworks.info&PORT=MyApplicationID_ddemo&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 browsercurl_exec($ch);// close cURL resource, and free up system resourcescurl_close($ch);



2011年,BES 5.0對BlackBerry OS 5/6/7的企業推送

,是基於參考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 optionscurl_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 browsercurl_exec($ch);// close cURL resource, and free up system resourcescurl_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 to a 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推送應用執行個體示範與分析


5)PHP的cURL庫簡介,使用案例

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.