Closed ankurrai02 closed 9 years ago
Hi @ankurrai02
if your push server is not on the same host and port as your html you must use JSONP to avoid cross domains javascript issues. Take a look on the example and check if your server is properly configured.
Thanks wandenberg
now i am geting push but i am geting following java script error while receiveing push with json data
SyntaxError: missing } after property list http://202.153.34.59/lp/dev_12?&tag=0&time=&eventid=&callback=PushStreamManager_0_onmessage_1422853560267&_=1422853560267 Line 2
my ngnix conf is
location /pub {
push_stream_publisher admin;
set $push_stream_channel_id $arg_id;
}
location ~ /lp/(.*) {
push_stream_subscriber long-polling;
set $push_stream_channels_path $1;
push_stream_message_template "{\"id\":~id~,\"channel\":\"~channel~\",\"text\":\"~text~\"}";
push_stream_longpolling_connection_ttl 30s;
}
do i need to change any thing in config ?
Check if your published message when it is applied to message_template it still a valid json. May be needed to remove the quote on template, from ,\"text\":\"~text~\" to ,\"text\":~text~ Or escape the message to a string and unescape it on your client.
Thankyou very much Wandenberg Its working :) just a small thing my json text has converted to pjson object any idea how to convert it back to json text
What do you mean by pjson? Can you give me an example to be easier help you?
Hi wandenberg
i fixed it by JSON.stringify , now its working Thanks again :)
)}