比如
$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\"}"}
很郁闷,见图:
0 个回复