COM301 - MSN Messenger Activity API

Download Report

Transcript COM301 - MSN Messenger Activity API

MSN Messenger Activity API
Scott Swanson
COM301
Group Product Planner
Microsoft Corporation
Agenda
What are MSN Messenger Activities?
Activity Application Demo
Creating an Activity Application
Provisioning/Deploying an
Activity Application
Debugging an Activity Application
Activities Application Building Contest
Summary
2
What Are Activity Applications?
One or two user applications built on the MSN
Messenger communication infrastructure
Connect Peer to Peer or through the MSN Cloud
Work across firewalls and proxies
Run in an IE window attached to the MSN Messenger
Conversation window
Can be hosted on the Internet or intranet
Interact with
Messenger conversation stream
Messenger user Info
Launch from inside or outside MSN Messenger
Contact based invitation model
Launch ability provisioned by MSN
3
Messenger Activity Platform
Applications can be built using DHTML
or ActiveX
Development options
ASP.NET, C/C++, C#, Visual Basic®,
VBScript, JScript®, HTML, DHTML, XML, and
more…
Great international support!
MSN Messenger Worldwide Support
25+ languages
45+ Markets
Can be market and/or language specific
4
MSN Messenger Activity Application
Scott Swanson/Carmen Zlateff
Group Product Planner/Lead Program Manager
MSN Messenger
5
Building An Activity Application
6
Design Considerations
IE 5.01 or greater required
Max window size 500 x 500 pixels
Connection Types
Indirect – via Messenger cloud
Data rate 195k per minute
Direct – Peer to Peer
Data rate limited by connection bandwidth
Security considerations require that
ActiveX applications be certified by MSN
Application should include a Help link
No adult, gambling, or hateful content
7
Messenger Activity Objects
External – Parent object
Channel – Client to client communication
Error – Error code and data
FileInfo – File transfer operations
Messenger – Shows Options dialogs
User – User properties
Users Collection – Enumerates user list
Access restricted
8
Required Definitions
Applications must sync these events
function Channel_OnRemoteAppLoaded() {
// The remote application is loaded and ready; start multiplayer
}
function Channel_OnRemoteAppClosed() {
// Remote application is shutting down; game over
}
function Channel_OnDataReceived() {
// Data received from remote app, inspect value of Channel.Data
}
function Channel_OnDataError() {
// Error during SendData, may need to retry.
}
function Channel_OnTypeChanged() {
// Inspect Channel.Type for the state of the connection (Direct, Indirect,
Disconnected)
}
function Channel_OnAppClose() {
// Messenger is shutting down, clean up application
}
9
Let’s Write Code…
10
Provisioning An Activity Application
11
What Is Provisioning?
Two step process
Enable you to test your application
Make application available to
MSN Messenger users
Why does MSN require provisioning?
Verify apps use the Activity API properly
Verify app compliance with Terms of Use
Give Messenger users a great experience
12
Provisioning Settings
Creating the msgrp2p.xml file
Enables MSN Messenger to load an
unprovisioned application for testing
Same XML as used by MSN servers
Adds item to the “Actions” menu
Start (Name)
(Name) defined by the Name element
Needed on both machines for testing
13
Creating msgrp2p.xml
Important values to set
EntryID = ‘7’ for test apps
Category = ’50’ for test apps
Sequence = ’10’ for testing
Name = String displayed in Actions menu
URL = HTTP address of Activity web page
Type
App=application
Dir=game
Height
Max=500
Width
Max=500
14
Provisioning Restricted Functionality
SendIM
Exposes EnterIM & SendIM methods in the Channel object
ReceiveIM
Exposes OnIMReceived event and IM property (ro)
ActiveX
Load ActiveX controls in local user security context
EnableIP
Allows access to local & global IP addresses
ReplaceIM
Exposes OnIMReceived event and IM property (rw)
SendFile
Exposes file xfer PEMs in the Channel object
UserProperties
Exposes Email and Name in User object
15
Launching An Activity Application
Launch from Actions menu
Start (Application Name)
Works prior to MSN provisioning
Launching From a Web Page
Only works after MSN provisioning
Invoke MSN Messenger by calling
http://messenger.msn.com/Resource/games.aspx?appID=APPID
The APPID value
Uniquely represents your Activity application
Assigned by MSN during provisioning
16
Creating The msgrp2p.xml
17
Debugging Activity Applications
18
Debugging Setup
Enable debugging in IE Advanced Tab
Uncheck “Disable script debugging (IE)”
Uncheck “Disable script debugging (Other)”
Place app and resources on web server
Multi-user apps require 2 machines to have
2 Messenger logins
Edit msgrp2p.xml to reference web server
Place msgrp2p.xml on test machines
C:\Program Files\MSN Messenger
19
Debugging Tips And Tricks
JavaScript: Use the “debugger” keyword to start
script debugging
Place “debugger” keyword at top of page
Enables variables in locals window
Enables setting breakpoints
Use Channel.SendIM to output debugging text to
conversation window
Reopen conversation to reload msgrp2p.xml
Application is reloaded on every invocation
Antispyware apps can change IE settings!
20
Running And Debugging
21
Worlds Greatest
Application Contest
http://activity.msn.com for details
Contest runs 9/12 to 12/31/2005
Entrant apps published twice/week
Enter as many apps as you like
Great Prizes
3 Alienware PCs, 10 Oakley Thump glasses, 65 copies
of Visual Studio 2005 Pro
Prizes awarded world-wide
Apps must be submitted in English
Winners announced Feb 2006
22
Community Resources
At the PDC
Hands On Lab: COMHOL34, Daily
Ask the Experts Table: Thurs 9/15, 5:30-9:30pm
MSN Messenger Booth
After the PDC
Messenger Developer Center
http://msdn.microsoft.com/msn/messenger
MSN Messenger forum
http://forums.microsoft.com/msdn/default.aspx?ForumGroupID
=23
Messenger Activity application contest
http://activity.msn.com
23
Conclusion
Focus on the app, not the infrastructure…
MSN communications infrastructure
simplifies crossing firewalls, routers, etc…
Messenger Activity API is available today
Reach 170 million users world-wide
Activity applications are ideal for
Interactive communication scenarios
Games
Photos, maps, sports, shopping, financial
24
© 2005 Microsoft Corporation. All rights reserved.
This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.