Presentation is loading. Please wait.

Presentation is loading. Please wait.

Razvoj web aplikacija za Skype for Business

Similar presentations


Presentation on theme: "Razvoj web aplikacija za Skype for Business"— Presentation transcript:

1 Razvoj web aplikacija za Skype for Business
RATKO ĆOSIĆ, Ekobit d.o.o. MCSD, MCITP, MCSE: Communication

2

3

4 Skype developer platform
Skype URIs Skype Web SDK Desktop Apps UCMA (Unified Communications Managed API) UCWA (Unified Communications Web API) Skype for Business SDN Interface

5 Skype for Business Online
Supported Topologies Lync 2013 Skype for Business Skype for Business Online Skype Web SDK Basic Yes Unified Communications Managed API (UCMA) No Unified Communications Web API (UCWA) Lync Server 2013 SDK Lync (Client) 2013 SDK Lync Server 2013 Persistent Chat SDK SDN Interface 2.2

6 Skype Developer Platform for Web
Set of JavaScript Web APIs and HTML controls. Web experiences of real-time collaboration. Services like presence, chat, audio, and video. Across a broad spectrum of users, platforms, and devices. The Skype Developer Platform for Web ("Skype Web SDK") is a set of JavaScript Web APIs and HTML controls that enable you to build web experiences that seamlessly integrate a wide variety of real-time collaboration models leveraging Skype for Business services and the larger Skype network. It provides support for multiple core collaboration services like presence, chat, audio, and video, enabling web experiences across a broad spectrum of users, platforms, and devices.

7 Skype Web SDK Arhitektura
The Skype Web SDK is designed to work in a Model - View - View model (MVVM) paradigm in which the SDK represents the model layer. A developer is responsible for creating a presentation layer and JavaScript logic in the view model layer that calls functions in the model. The SDK uses common HTTP verbs to implement REST style communication with the Skype for Business server. The Web SDK JavaScript library implements the HTTP request and response handling and exposes a simple presence and conversation API that you use to get and set user availability, get the availability of other users, and start conversations with users. It also handles Basic, integrated, and OAuth user authentication, presence subscription, and conversation operations.

8 Skype Web SDK object model
The object model is shown in the following figure (Figure 1). Use the Application constructor and the new keyword to create an Application object of the Skype.Web.Model.Application type. Application is the only object with a constructor. All other objects are obtained according to figure below.

9 Skype Web SDK core capabilities
Purpose Presence Use presence information to help users decide whether and how they should person other users. Local user Use the mePerson object to represent the currently signed-in user. Conversations Use conversation services to determine the ways for communication between persons. Groups Use a person group to contain related persons. Person Lists The all.persons contains all of the user's persons. Listening for and generating presence events Use events to get a person's current presence. Persons Use person objects to represent individual users. Devices Select Cameras, Microphones, and Speakers to use for audio and video conversations. The following table lists tasks that are the building blocks of creating web and mobile applications using the Skype Web SDK.

10 https://msdn. microsoft. com/en-us/library/office/dn962162(v=office

11 DEMO: Ogledna client-side web aplikacija (SfB komunikator)

12 Korištenje Skype Web SDK
Nema instalacije! CDN link: <script src=" Skype for business Web App Plug-in Za audio i video Bootstrapping the app

13 Bootstrapping the application

14 Retrieve the API entry point and sign in a user
Application SignInManager The Application object is created by invoking the Application class constructor with the new keyword. This is the only SDK object that can be constructed in application logic. All other SDK types are accessed by reading properties or invoking functions on application. The SignInManager#signIn method and the SignInManager#signOut method are asynchronous and return a Promise object. Use the Promise#then method to set operation success or failure callbacks. Call the Application constructor. Sign the user in by calling the Application#signInManager.signIn method.

15 Show a person's information
PersonsAndGroupsManager Person The person information that a signed-in user can get for another user is restricted by the privacy relationships between the two users. When a privacy relationship restricts access to person information, the Person property for that information is undefined. After the user is signed in, your application can perform the following procedure. The desired person may not be in the user's person list. In that case, see Search for persons and distribution groups to learn about providing a person search feature. 1. Handle the PersonsAndGroupsManager#persons.added event to put the added person on a webpage. 2. Add an event handler for the Person#status property changed event. Update the webpage with the new availability of the person. 3. Read the Person#displayName property to get the person's name. 4. Read the Person#title property to get the person's business title. 5. Read the Person#department property to get the person's work department. 6. Read the Person#company property to get the person's company name.

16 Search for persons and distribution groups
Queries A Person represents a user. The Person object can be queried for information about a person, such as their availability to join a conversation. The Person object is passed to the conversation starting methods, such as the ConversationsManager.getConversation method, so that the conversation invitation is sent to the person represented by the Person object. A Group can represent a distribution group, server-defined person set, or user-defined person set. If the Group is a distribution group, it can also link to other distribution groups. Persons in a distribution group are represented by Person objects. The arguments for the PersonsAndGroupsManager.createGroupSearchQuery method include a partial or full name query and a numeric limit to the size of the result sets. Results include a collection of distribution groups. To find persons, use the PersonsAndGroupsManager.createPersonSearchQuery method. The following procedure assumes that a user has signed in before searching for persons and groups. 1. Create a SearchQuery for person search: personsAndGroupsManager.createPersonSearchQuery. 2. Specify the search terms in the SearchQuery. 3. Execute the searchQuery.getMore method and get the search results in the onSuccess method. 4. Call the forEach method of the array of results. For each result, Person object is the result.result.

17 Get a person and listen for availability
Observable properties Subscriptions The SDK gives you access to a user's person list. A user can start a conversation with a person from of her person list or from a person search result. After a user gets a Person from one of these sources, she can start a conversation as long as the person's presence shows as available. Your app should show current person presence to give a real-time view of the availability of any person displayed in a UI. To request continued presence notifications from Skype for Business Server when a person's presence changes, get the person you are interested in and add a listener for changes in the Person.status property. 1. Get a person from the user's person list or from search results. 2. Register a listener for the "changed" event on the Person.status Property. 3. In the listener method, show the new availability on your UI. 4. Call status.subscribe method to subscribe for update of the person's status. In this case, the code is getting a reference to the status Property and the subscribe function is called on the property reference.

18 Start a conversation ConversationManager
Call the ConversationsManager.getConversation method, with a person for the only argument, to create a conversation object. Call the start method on the desired modality to add the modality and start the conversation. See the following topics to add modalities:

19 Respond to a conversation invitation
Conversation’s services: chatService audioService videoService A conversation invitation is extended to the local user to join a conversation. Invitations can come from any version of the Skype for Business client, another Skype Web SDK-enabled webpage, or a compatible client from the public cloud. The SDK creates a set of objects and raises several events to support a new conversation. A Conversation object is created to encapsulate the incoming conversation invitation. One or more conversation service objects such as Conversation.chatService, Conversation.audioService, or Conversation.videoService is created to encapsulate the conversation modes chosen by the caller. One or more Participant objects are created to represent the people in the conversation. The state of one of the conversation's modalities becomes "Notified." At this moment, the app must call the accept() method or the decline() method on the ConversationService modality object. Whether the call is taken or declined depends on which method is called. The following procedure catches the conversation-related "added" events, forms a UI prompt, accepts the user's action, and updates the app UI to show the right kind of content.

20 Join an existing meeting
A user can join an existing meeting with that meeting's URI.

21 Send and receive text in a conversation
historyService Receiving messages in a conversation involves getting a conversation object and conversation instant message modality. When the conversation is connected, listen for new messages. When a message is received, get the sender name and message text. 1. Get the conversation history service. 2. Listen for new incoming messages. 3. Determine the type and direction of the activity item. 4. Get the message sender's name. The displayName property contains the display name of the sender. If the display name is not available, the sender's id value is returned. Otherwise, the example returns 'Unknown participant'. 5. Get the message text.

22 Sending a message chatService
Sending a message involves getting a connected conversation and the conversation chat service. When the user has provided text for a message, send the message on the chatService of the conversation. Get the conversation chat service. Listen for the conversation.SelfParticipant.Chat.state to change to "Connected.„ Send message text.

23 Add participants to a conversation
Additional Persons can be added to a conversation to escalate that conversation to an online meeting. Create a conversation participant. Add the participant to the conversation. An event can be subscribed to that is fired when a new participant is added to the conversation.

24 Add or remove audio in a conversation
audioService With an existing conversation instance, audio can be added or removed. An event is fired when the client has successfully added audio to the conversation, or another participant has invited the client to add audio: Subscribe to the event. If the val argument in the previous snippet indicates the event is an invitation to add audio, the client may reject or accept the invitation. Calling videoService.accept() in response to an audio invitation does nothing. Calling videoService.accept() in response to a video invitation will accept the audio and video and start its own video as well: The client may temporarily mute their own audio in the conversation. The client may also place itself on hold, temporarily pausing all incoming and outgoing audio.

25 Add or remove video in a conversation
videoService With an existing conversation instance, video can be added or removed. You may also set the video window container prior to starting the videoService. Note: Setting the video container more than one time for the same video stream will cause problems with video playback. Video can also be removed by stopping the audioService. An event is fired when the client has successfully added video to the conversation, or another participant has invited the client to add video. Clients can accept requests for video without sending their own video by calling audioService.accept().

26 Manage devices devicesManager
Before accessing the device lists in devicesManager, the client must call that respective list's subscribe() function. After this function is called changes to the collection are exposed to the client, and the client may enumerate the devices in that list. The devicesManager object has three collections for available devices: cameras, microphones, and speakers. Each collection can be iterated over to get a reference to each device: The devicesManager object has a reference to each currently selected device: selectedCamera, selectedMicrophone, and selectedSpeaker. Each reference can be changed with their respective set() function. (Note: this function will appear enabled but will have no effect if the device is already in use.) The client can subscribe to changes to the selected devices by calling their respective changed() functions.

27 Conversation Control This topic takes you through the steps to add a Conversation Control to you web app. Upon completion of these tasks, your app will let a user sign in to Skype for Business on premise, initiate a new IM conversation with one or more people, and accept invitations to join an IM conversation.

28 Add the Conversation Control to a webpage
API keys Declare a structure to hold the API keys. Important The API key values shown in this example are the literal values that you must use in your application. If you use any other strings, your application will not initialize the API endpoint.Change the value of the version key to uniquely identify your app. See Skype Web SDK Production Use Capabilities for a list of supported API keys. Initialize the API endpoint and get the UIApplicationInstance that provides the Conversation Control.

29 Add a chat state event handler
renderConversation Inside of the callback function passed into the initialize method, add a callback to be invoked when a conversation is added to the collection on the ConversationsManager. Inside of the previous callback method, add a callback for changes in the chat channel state of the added conversation. When the state of the channel is changed to 'Notified', an invitation to chat has been received. To show the Conversation Control, call the renderConversation method on the UIApplicationInstance. renderConversationRender a conversation in given context Parameters - container - (String/DOMelement ) Optional. A CSS selector or DOM element - state - Object{} Optional. Object holding the optional parameters - participants - Array Optional. Array of participants to start a conversation with. - conversationId - String Optional. Conversation ID to start conversation with. Can't be used together - state.participants. - modalities - Modality[] Optional. Array of modalities to start with

30 DEMO: Kako to sve radi?

31 Skype bots At today’s Build 2016 conference, Microsoft CEO Satya Nadella showcased how these technologies work together to bring you entirely new experiences. The Cortana and Skype demonstration showed how Cortana, your personal digital assistant, can help you get things done directly in your Skype chats. For example, Cortana proactively helps you find information, manages your calendar and connects to other Bots that are relevant to you, all without leaving Skype. We also introduced a new interaction on Skype—Skype Video Bots, taking a different approach to bringing useful and fun interactions into your video calling experiences. The Skype Bot Platform We are excited to see what our developers can create with Skype Bots as well, and that’s why we’re happy to announce the release of the Skype Bots Platform which includes: The SDK, API and Workflows all in the new Skype Bots Portal at skype.com/developer. This is only the beginning of taking this exciting technology and together, we can shape what it looks like to shop, play a game, order food, schedule meetings, book trips, control your smart home and more.

32

33


Download ppt "Razvoj web aplikacija za Skype for Business"

Similar presentations


Ads by Google