SwellRT / swellrt

SwellRT main project. Server, JavaScript and Java clients
http://swellrt.org/
Apache License 2.0
234 stars 34 forks source link

Document new login() logout() resume() API functions #184

Closed pablojan closed 8 years ago

pablojan commented 8 years ago

Now, logout() and resume() supports a id parameter to try to close or keep a particular session!

   SwellRT.resume(
    {
        id : "tam@local.net"
    },

    function(res) {

        if (res.error) {
            console.log(res.error);
        } else if (res.data) {
           _data = res.data;
        }

    });

    SwellRT.resume(

    // Parameters

    {
    },

    // onComplete callback

    function(res) {

        if (res.error) {
            console.log(res.error);
        } else if (res.data) {
           _data = res.data;
        }

    });

    SwellRT.login(

    // Parameters

    {
        id : "tam@local.net",
        password : "tamtam"
    },

    // onComplete callback

    function(res) {

        if (res.error) {
            console.log(res.error);
        } else if (res.data) {
           _data = res.data;
        }

    });

    SwellRT.logout(
        // onComplete callback

        function(res) {

            if (res.error) {
                console.log(error);
            } else if (res.data) {
               _data = res.data;
            }

        });