>php教程 >php手册 >Android 推送消息(MQTT) PHP发送

Android 推送消息(MQTT) PHP发送

WBOY
WBOY원래의
2016-06-06 19:59:061881검색

1.服务器安装:IBM的 RSMB (MQTT协议代理) Really Small Message Broke(rsmb_1.2.0) http://download.csdn.net/detail/wuzehai02/4735055 安装 To start the broker on Windows: In the folder where you installed the broker, double-click broker.exe .

1.服务器安装:IBM的 RSMB (MQTT协议代理)

Really Small Message Broke(rsmb_1.2.0)
http://download.csdn.net/detail/wuzehai02/4735055

安装  

To start the broker on Windows:

  1. In the folder where you installed the broker, double-click broker.exe.

To start the broker on Linux:

  1. In a terminal, change to the directory where you installed the broker; for example:
    cd /home/laura/broker
  2. Enter the appropriate command for your platform. For example, on Ubuntu, type:
    ./broker.ubuntu

    Alternatively, to run the broker in the background so that it will continue to run when you log out of the session, enter the following command:

    nohup ./broker.ubuntu >> /dev/null &

The broker is now ready to publish messages.

To stop the broker cleanly, type Ctrl-C. On Linux, if you prefer, you can just kill the process of the running broker:

ps -ef | grep broker
kill -term <var>process_id_of_the_running_broker</var>



2 服务器消息发送方:
PHP服务器端使用的是:SAM 针对MQTT写的PHP库 (下载链接为Tokudu PHPMQTT通信项目),其中send_mqtt.php是一个通过POST接收消息并且通过SAM将消息发送给RSMB的PHP脚本。
下载地址
http://download.csdn.net/detail/wuzehai02/4735078

Android 推送消息(MQTT) PHP发送

3  ANDROID 客户端的消息PUSH DEMO

下载地址
http://download.csdn.net/detail/wuzehai02/4735172





经过本人测试过,代码绝对可用



성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.