Pages Menu
TwitterRssFacebook

Posted by on May 8, 2015 in Learn Skype Web SDK

Learn Skype Web SDK Day 7 : Setting Your Own Presence

Learn Skype Web SDK Day 7 : Setting Your Own Presence

[contemplate-1]
View Demo

We know how to get our own presence, but what about setting it? It’s easy!

We can use the same mePerson object that we used to get presence, by passing the new presence state to the state() method, shown in this example where we set the presence to Do Not Disturb:

[code language=”javascript”]

var client;

client.personsAndGroupsManager.mePerson.state(‘DoNotDisturb’);

[/code]

Valid presence states you can pass are (and must be typed exactly):

  • Online
  • Busy
  • DoNotDisturb
  • BeRightBack
  • Away
  • OffWork*

*The OffWork state is a slightly odd one because although you can set it, you never see it coming back as a presence state. When you set it, what you see is a presence state of Away, and an activity status of off-work.

In the example I’ve expanded the code from the Get Presence example, and added a drop-down box to allow the setting of presence:

[code language=”javascript”]




[/code]

Demo Online

You can try this code out against your own Skype for Business environment by going to the demo page. From here you can also download the code from GitHub if you want to host it locally, or take it and use it in your next project.
[contemplate-2]

Post a Reply

Your email address will not be published. Required fields are marked *