注册

PHP发送信息客户端收不到

PHP通过Rest API发信息,服务器返回是成功,但客户端收不到信息。提交和返回的数据如下:



提交网址:

https://a1.easemob.com/****/****/token

POST数据:
{"grant_type":"client_credentials","client_id":"YXA6Ds19wCU1EeSg1Dm8N-qgWQ","client_secret":"YXA6lRyfNBe04iUoOzVHPUzFfWdSCRA"}

返回结果:

{"access_token":"YWMtmKVkcPLrEeS3-vVIfxS0zAAAAU5Xo_3gurR4uBJ5X0QES0YbfHY1DdxmFec","expires_in":5184000,"application":"0ecd7dc0-2535-11e4-a0d4-39bc37eaa059"}

---------------------------------------
提交网址:

https://a1.easemob.com/****/****/messages

POST数据:
{"target_type":"users","target":,"msg":{"type":"txt","msg":"hello"},"from":"10000","ext":[]}

返回结果:

{ "action" : "post", "application" : "0ecd7dc0-2535-11e4-a0d4-39bc37eaa059", "uri" : "https://a1.easemob.com/yebaim/seeu", "entities" : , "data" : { "10006" : "success" }, "timestamp" : 1430805442354, "duration" : 0, "organization" : "****", "applicationName" : "****" }

---------------------------------------
已邀请:
请帮忙看下

beyond - imgeek运营

把"ext":[]去掉,扩展属性, 由app自己定义.可以没有这个字段,但是如果有,值不能是“ext:null“这种形式!
那PHP服务端能否发带扩展属性的透传消息给APP,我们现在提交的数据和返回是这样,但也是收不到:
提交网址:

https://a1.easemob.com/****/****/token

POST数据:
{"grant_type":"client_credentials","client_id":"YXA6Ds19wCU1EeSg1Dm8N-qgWQ","client_secret":"YXA6lRyfNBe04iUoOzVHPUzFfWdSCRA"}

返回结果:

{"access_token":"YWMtI1yxRPPEEeSYc1vk9LqDFgAAAU5dLx7V6Pgae7Kb1AYZ-ByWIgFQ1peSNeI","expires_in":5184000,"application":"0ecd7dc0-2535-11e4-a0d4-39bc37eaa059"}

---------------------------------------
提交网址:

https://a1.easemob.com/****/****/messages

POST数据:
{"target_type":"users","target":,"msg":{"type":"cmd","action":"users\/contacts\/request"},"from":"60","ext":{"id":16,"sponsor_id":60,"recipient_id":59,"response_type":0,"request_time":1430720309,"response_time":0}}

返回结果:

{ "action" : "post", "application" : "0ecd7dc0-2535-11e4-a0d4-39bc37eaa059", "uri" : "https://a1.easemob.com/****/****", "entities" : , "data" : { "59" : "success" }, "timestamp" : 1430898446354, "duration" : 5, "organization" : "****", "applicationName" : "****" }

---------------------------------------

beyond - imgeek运营

本帖最后由 beyond 于 2015-5-6 18:10 编辑

上面那个发送没问题了吧,透传里面是可以加扩展属性的,我用你写的那个透传格式发给客户端没问题,是不是用户写错了之类的?

要回复问题请先登录注册