查询在线用户 - GoEasy IM

开通

本特性为高级功能,默认不开通,付费应用,可以在我的应用->查看详情,高级功能里自助开通。

资费

每成功调用一次扣减消息数1条

根据userId获取当前在线客户端列表


        im.hereNow({
            userIds:['user001','user002'], //每次查询最多不超过50个
            onSuccess: function (result) { 
                // result示例
                // {
                //     "code": 200,
                //     "content": [
                //         {"id": "user001","data": {"name":"Mattie"}},
                //         {"id": "user002","data": {"name":"Jack"}},
                //         {"id": "user003","data": {"name":"Mike"}}"
                //     }]
                // };    
                console.log("Query online user list successfully, result:\n " + JSON.stringify(result)); 
            },
            onFailed: function (error) { //连接失败
                console.log("Failed to mark as read, code:" + error.code + " content:" + error.content);
            }
        });

results matching ""

    No results matching ""