ApplicationController に app_key、key、および secret があります
私のプッシャーコントローラー:
def auth
if current_user
auth = Pusher[params[:channel_name]].authenticate(params[:socket_id],
:user_id => current_user.id, # => required
:user_info => { # => optional
:name => current_user.name,
:email => current_user.email
}
)
render :json => auth
else
render :text => "Not authorized", :status => '403'
end
end
私のjs
var pusher = new Pusher("key");
Pusher.channel_auth_endpoint = "/pusher/auth";
Pusher.channel_auth_transport = 'json';
channel = pusher.subscribe("presence-content_editing");
私は説明に従ったと確信していますhttp://pusher.com/docs/presence-1.6
なぜこのエラーが発生するのか混乱しています
this is the error :
Uncaught TypeError: Cannot call method 'scopedTo' of undefined
Pusher.Channel.PrivateChannel.authorizepusher.min.js:38
Pusher.subscribepusher.min.js:13
Pusher.subscribeAllpusher.min.js:12
connection.bind.bind.cpusher.min.js:10
a.emitpusher.min.js:17
jpusher.min.js:25
_machine.b.Machine.connectedPostpusher.min.js:29
apusher.min.js:19
c.transitionpusher.min.js:20
w