KAA平台系列文章:
一、网页形式
官网:http://kaaproject.github.io/kaa/docs/v0.10.0/Programming-guide/Key-platform-features/Notifications/
配置: 通知 --> 通知主题 --> 端点组,即可在“通知主题”下发通知
注:代码见KAA平台的数据上传
二、脚本形式
接口地址:
http://192.168.0.110:8080/kaaAdmin/rest/api/sendUnicastNotification
得到通知模式的schema_id: db.notification.find()
授权: chmod +x *.sh
其他数据在MariaDB数据库获取
1262358.sh
curl -v -S -u WDJL_SYH:kaa123 -F 'notification={"applicationId":"131072","schemaId":"163845","topicId":"98304","type":"USER"};
type=application/json' -F 'endpointKeyHash=74xdPqVyQZ0eLmrLSj2P2Q8kPfo=;
type=text/plain' -F file=@/usr/local/S/168369519.json
"http://192.168.0.110:8080/kaaAdmin/rest/api/sendUnicastNotification"
1262358.json
{"Message": "fn:24,seq:1502097735986,type:request,du:[{epid:31431793435902E0,controlType:1},
{epid:31431793435902E1,controlType:1}]"}
123.json
{"Message": "下发消息:12345,上山打老虎。"}
三、Postman
接口地址:
http://192.168.0.110:8080/kaaAdmin/rest/api/sendUnicastNotification