GoEasyIM - 查询当前在线用户列表

开通

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

资费

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

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


        var options = {
            userIds:['user001','user002'] //每次查询最多不超过50个
        };

        var promise = im.hereNow(options);

        promise.then(function (result) {
            // result示例
            // {
            //     "code": 200,
            //     "content": [{
            //         "userId": "user001","userData": "{\"name\":\"Mattie\"}",
            //         "userId": "user002","userData": "{\"name\":\"Jack\"}",
            //         "userId": "user003","userData": "{\"name\":\"Mike\"}"
            //     }]
            // };    
            console.log("Query online user list successfully, result:\n " + JSON.stringify(result));
        }).catch(function (error) {
            console.log("Failed to query online users, code:" + error.code + " content:" + error.content);
        });

results matching ""

    No results matching ""