Beruflich Dokumente
Kultur Dokumente
Synchronizing Life
Communications –
Messenger, Presence, Alerts
and Activities
1
Agenda Live Services
Synchronizing Life
• Overview
• Messenger Library
• Messenger IM Control
• Presence API
• Alerts
• Activities
2
Session objectives and takeaways Live Services
Synchronizing Life
3
Overview Live Services
Synchronizing Life
4
Build Rich Social Apps Live Services
Synchronizing Life
5
Demo
Live Services
Synchronizing Life
Tafiti
6
Communications within the Live Framework Live Services
Synchronizing Life
Libraries
.NET FX 3.5 APIs Silverlight APIs JavaScript APIs Client Controls Web Controls …
Tools &
Services
Resource Model
Developer
ATOM JSON POX RSS Binary XML Portal
AtomPub FeedSync
Resource
CRUD Sync URI-LINQ Triggers Auth/Z Hosting Introspection
Scripts
Core Data Communications App Model
Provisioning /
User Account
Identity P2P Catalog Management
Folders News
Device Mesh Notifications Hosting
Photos Favorites
Applications Presence Mesh Applications
Contacts Groups
App Data & Settings
Profile Calendar Visual Studio
Application Management Tools /
System Designers
Geospatial
Search
11
User requirements Live Services
Synchronizing Life
• Browser support
– IE 6, 7 & 8
– Firefox 1.5, 2.0 & 3.0
– Safari 3.0
12
Live Services
Synchronizing Life
Messenger Library
13
Development with Messenger Live Services
Synchronizing Life
Library
• Sign-in
1. Instantiate Microsoft.Live.Messenger.UI.SignInControl
2. Subscribe to the AuthenticationCompleted event
3. Define event handler for AuthenticationCompleted
1. Instantiate User object
2. Subscribe to User.SignInCompleted
3. Call User.SignIn
4. Define event handler for User.SignInCompleted
5. After authentication the User object is ready to use
• User Object
1. Represents signed in user
2. Provides access to user’s contact
• Channel and Privacy pages
1. Required to host these pages
2. Channel.htm used for cross-domain communication
14
Monitoring Presence (status) Live Services
Synchronizing Life
15
Monitoring Online/Offline Live Services
Synchronizing Life
_user.get_onlineContacts().add_collection
Changed(onlineContacts_CollectionChanged);
_user.get_offlineContacts().add_collection
Changed(offlineContacts_CollectionChanged);
16
Changing User Presence Live Services
Synchronizing Life
_user.get_presence().set_status(Microsoft
.Live.Messenger.PresenceStatus.online)
;
17
Managing User Contacts Live Services
Synchronizing Life
18
Manage Conversations Live Services
Synchronizing Life
19
Live Services
Synchronizing Life
Presence API
20
Presence API Live Services
Synchronizing Life
• Supported browsers
– IE 6 or higher
– Firefox 1.5 or higher on Windows
21
Developing Online Presence Live Services
Synchronizing Life
22
Live Services
JSON Presence Result Synchronizing Life
{
"status": "Online",
"icon":
{
"height": 16,
"url": "http://settings.messenger.live.com/static/w13r2/Conversation/
img/Status_Online.gif",
"width": 16
},
"statusText": "Online",
"id": "12BACD345678@apps.messenger.live.com",
"displayName": "Name"
}
23
Querying Presence Live Services
Synchronizing Life
24
JSON Elements Live Services
Synchronizing Life
Element Description
status Online, Away, Idle, BeRightBack, Busy,
OutToLunch
statusText The user's status as a localized string.
OnThePhone, Offline
id The ID that was passed in to the API call.
displayNam The Messenger display name of the user.
e
mkt Specifies a culture ID indicating the language.
icon References an icon representing the user’s
status.
icon.url The URL of the status icon image.
icon.width The width of the status icon image in pixels.
icon.height The height of the status icon image in pixels.
25
Demo
Live Services
Synchronizing Life
26
Live Services
Synchronizing Life
Messenger Control
Messenger IM Control Live Services
Synchronizing Life
• Navigate to:
• http://settings.messenger.live.com/applications/
websettings.aspx
• Select the Allow websites to see your Messenger
status and send you messages check box and
click Save
• Under Web Settings, click Create HTML
• Copy the HTML and paste it into your Web page
28
Inviting Users Live Services
Synchronizing Life
29
Demo
Live Services
Synchronizing Life
http://settings.messenger.live.com/applications/
WebSettings.aspx
30
Live Services
Synchronizing Life
Alerts
Alerts SDK Live Services
Synchronizing Life
• SOAP Protocol
• Programmatic Integration
– Add/Remove group
– Publication sign-up
– Subscribe/Unsubscribe end-user
– Deliver message
– Inquire about user subscription
– Inquire about available groups
32
Live Services
Synchronizing Life
33
Security Live Services
Synchronizing Life
• Partner Identification
– Each Alerts Partner is provided with a unique
PIN and password.
– The PIN and password are required in all
message transmissions to Alerts.
• Partner IP
– Alerts validates each request against a
specified list of legal IP addresses. This list
of addresses must be supplied to Alerts and
verified before the site can operate in
production mode.
34
Production and Testing Live Services
Synchronizing Life
Environments
• Testing URIs
– Message: http://services.alerts.live-ppe.com/axis/services/Message
– Subscription: http://services.alerts.live-ppe.com/axis/services/Subscription
• Production URIs
– Message: http://services.alerts.live.com/axis/services/Message
– Subscription: http://services.alerts.live.com/axis/services/Subscription
35
Live Services
Synchronizing Life
Activities
Windows Live Messenger Live Services
Synchronizing Life
Getting Started
41
Live Services
Windows Live Messenger Activities Synchronizing Life
Event Handling
• When a Windows Live Messenger Activity is running, the
Windows Live Messenger script engine is firing events to the
application.
• In order for two instances of the application to communicate
with each other, appropriate event handlers must be defined.
For example, if the SendData method is used to send a string
from one instance to the other, an OnDataReceived event
handler must be defined to receive the string.
• Some commonly used event handlers are:
– OnRemoteAppLoaded
– OnRemoteAppClosed
– OnDataReceived
– OnDataError
– OnTypeChanged
– OnAppClose
Live Services
Windows Live Messenger Activities Synchronizing Life
Multi-User Activities
• Multi-user activities can exchange data and synchronize between two
instances
44
Special Permissions Live Services
Synchronizing Life
– Instant messaging
– Application sharing
46
Submission Process Live Services
Synchronizing Life
• Functional spec
– Special permissions and features (next
slide)
• Test plan
– Demonstrate compliance with
requirements
• Test case documentation
– Test case details
48
Other requirements Live Services
Synchronizing Life
49
Testing Live Services
Synchronizing Life
• Copy MSGRP2P.xml
– Copy to 2 computers if multi user
• XML changes
– <Name>Tic Tac Toe</Name>
– <URL>http://server/app/defaulthtm</
URL>
50
Demo
Live Services
Synchronizing Life
Sample Activity
51
Live Services
Get Started
Discussion
Live Services
Synchronizing Life
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or
other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to
changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date
of this presentation.
MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.