pyj2004
pyj2004
  • 发布:2015-08-31 11:39
  • 更新:2015-08-31 11:39
  • 阅读:2668

push推送客户端用receive事件接收payload参数问题

分类:HTML5+

比如

$tosend = array (  
                            'type' => 1,  
                            'content' => 2  
                    );  
$payload = json_encode($tosend );  
$template->set_transmissionContent ($payload );

当payload是json格式的字符串时候,在ios和android下有差异!!
ios下receive事件接收到payload是对象:
{"title":"testapp","payload":{"type":"1","content":"2"}}

但android下确是字符串,如:
{"title":"testapp","payload":"{\"type\":\"1\",\"content\":\"2\"}"}

很郁闷,见图:

2015-08-31 11:39 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复