Waj*_*man 1 javascript php pusher
我有一个使用jquery mobile和phonegap的移动网络应用程序,其他是php网站.我希望只发送通知给在线和移动应用程序的特定用户,在php网站上接收用户在线的通知以及移动网络应用程序所以我的问题是如何为特定用户设置频道,因为现在通知发送给所有用户,这些用户对消息和连接没用.
目前,我的代码向所有人发送通知可以解决这个问题,我的代码需要进行更改.
在事件触发器上我有那个代码php网站.
$message = "User Response Has been Sent For Taxi On way";
$pusher = new Pusher( APP_KEY, APP_SECRET, APP_ID );
$data = array('message' => $message);
$pusher->trigger( 'dispatcher_channel', 'dispatcher_Response', $data );
Run Code Online (Sandbox Code Playgroud)
在移动网络应用程序上,我有该代码.
Pusher.log = function(message) {
if (window.console && window.console.log) {
window.console.log(message);
}
};
var pusher = new Pusher('APP_KEY');
var channel = pusher.subscribe('dispatcher_channel');
channel.bind('dispatcher_Response', function(data) {
alert(data.message);
channel.bind('dispatcher_Response', function(data) {});
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3555 次 |
| 最近记录: |