Top

rainbowSDK.presence.RAINBOW_ONCONTACTPRESENCECHANGED is not triggered.

Commentaires

3 commentaires

  • Sunny Singh

    Hello,

     

    I am sharing my sample code below,

    None of the presence event getting trigger when the presence status of a user in the contact list is changed.

     

    /* Wait for the page to load */
    $(document).ready(function() {
        console.log("[DEMO] :: Rainbow Application started!");


        // Update the variables below with your applicationID and applicationSecret strings
        var applicationID = "********",
            applicationSecret = "********";

        /* Bootstrap the SDK */
        angular.bootstrap(document, ["sdk"]).get("rainbowSDK");

        /* Callback for handling the event 'RAINBOW_ONREADY' */
        var onReady = function onReady() {
            var myRainbowLogin = "thiyam.sunny*******";       // Replace by your login
            var myRainbowPassword = "********"; // Replace by your password

            // The SDK for Web is ready to be used, so you can sign in
            rainbowSDK.connection.signin(myRainbowLogin, myRainbowPassword)
            .then(function(account) {
                  // Successfully signed to Rainbow and the SDK is started completely. Rainbow data can be retrieved.
                  //...
            })
            .catch(function(err) {
                  // An error occurs (e.g. bad credentials). Application could be informed that sign in has failed
                  //...
            });
        };

        /* Callback for handling the event 'RAINBOW_ONCONNECTIONSTATECHANGED' */
        var onLoaded = function onLoaded() {
            console.log("[DEMO] :: On SDK Loaded !");

            // Activate full SDK log
            rainbowSDK.setVerboseLog(true);

            rainbowSDK
                .initialize(applicationID, applicationSecret)
                .then(function() {
                    console.log("[DEMO] :: Rainbow SDK is initialized!");
                })
                .catch(function(err) {
                    console.log("[DEMO] :: Something went wrong with the SDK...", err);
                });
        };

        var onContactPresenceChanged = function onContactPresenceChanged(event) {
            console.log("[DEMO] :: onContactPresenceChanged!");
        };

        var onPresenceChanged = function onPresenceChanged(event) {
            console.log("[DEMO] :: onPresenceChanged!");
        };

        var onContactRichPresenceChanged = function onContactRichPresenceChanged(event) {
            console.log("[DEMO] :: onContactRichPresenceChanged!");
        };

        var onReachPresenceChanged = function onReachPresenceChanged(event) {
            console.log("[DEMO] :: onContactRichPresenceChanged!");
        };

        var onConnectionStateChangeEvent = function onConnectionStateChangeEvent(event) {
            console.log("[DEMO] :: onContactRichPresenceChanged!");
        };


        /* Listen to the SDK event RAINBOW_ONREADY */
        document.addEventListener(rainbowSDK.RAINBOW_ONREADY, onReady)

        /* Listen to the SDK event RAINBOW_ONLOADED */
        document.addEventListener(rainbowSDK.RAINBOW_ONLOADED, onLoaded)

        document.addEventListener(rainbowSDK.presence.RAINBOW_ONCONTACTPRESENCECHANGED, onContactPresenceChanged)
        document.addEventListener(rainbowSDK.presence.RAINBOW_ONPRESENCECHANGED, onPresenceChanged)
        document.addEventListener(rainbowSDK.presence.RAINBOW_ONCONTACTRICHPRESENCECHANGED, onContactRichPresenceChanged)
        document.addEventListener(rainbowSDK.presence.RAINBOW_ONRICHPRESENCECHANGED, onReachPresenceChanged)
        document.addEventListener(rainbowSDK.connection.RAINBOW_ONCONNECTIONSTATECHANGED,onConnectionStateChangeEvent)


        /* Load the SDK */
        rainbowSDK.load();
    });
     
     
     
    Regards,
    Sunny
    0
    Actions pour les commentaires Permalien
  • Konrad Hyzy

    Hello,

     

    this bug is going to be fixed in the next SDK version, for the moment you can use an 'old' jQuery listener to retrieve this event.

     

    Best Regards,

    Konrad

    0
    Actions pour les commentaires Permalien
  • Sunny Singh

    Hello Konrad,

    Thank you for the information.

    Regards,

    Sunny

    0
    Actions pour les commentaires Permalien

Vous devez vous connecter pour laisser un commentaire.

Vous n'avez pas trouvé ce que vous cherchez?

  • Contactez-nous

    Vous avez des questions? Laissez-nous un message pour obtenir plus d'informations.

    Contactez-nous
  • Demandez à la Communauté

    Vous avez besoin d'aide? Posez vos questions à la Communauté et obtenez des réponses d'autres utilisateurs Rainbow.

    Poster un message