IMServiceApplication Protocol Reference
| Conforms to | |
| Framework | /System/Library/Frameworks/IMServicePlugIn.framework |
| Availability | Available in OS X v10.7 and later. |
| Declared in | IMServicePlugInProtocols.h IMServicePlugInTypes.h |
Overview
A service plug-in communicates with the instant messaging client using the IMServiceApplication protocol. An object implementing this protocol is passed to your service plug-in by the initWithServiceApplication: method.
Instance Methods
plugInDidFailToAuthenticate
Indicates that the session failed to authenticate with the instant message service. (required)
Discussion
The instant messaging client re-requests the user name and password and either calls the IMServicePlugIn updateAccountSettings: method with the new settings or, if the user cancels, calls the IMServicePlugIn logout method.
Availability
- Available in OS X v10.7 and later.
Declared In
IMServicePlugInProtocols.hplugInDidLogIn
Indicates that the session logged in. (required)
Discussion
Availability
- Available in OS X v10.7 and later.
Declared In
IMServicePlugInProtocols.hplugInDidLogOutWithError:reconnect:
Indicates that the session logged out. (required)
Parameters
- error
The error, if any, that caused the disconnection. If this method is called in response to the
IMServicePlugInlogoutmethod being called, error should benil.- reconnect
A Boolean value indicating whether the instant messaging client should try to reconnect.
Discussion
Availability
- Available in OS X v10.7 and later.
Declared In
IMServicePlugInProtocols.hplugInDidUpdateProperties:ofHandle:
Indicates that one or more properties of a handle have changed. (required)
Parameters
- changes
A dictionary of the new handle properties for the handle. For a list of keys, see “Handle Properties.”
- handle
A handle.
Discussion
This method should also be called once for each handle in the updated group list after the plugInDidUpdateGroupList:error: method is called.
Availability
- Available in OS X v10.7 and later.
Declared In
IMServicePlugInProtocols.hConstants
Handle Properties
Keys used in the dictionary passed to the plugInDidUpdateProperties:ofHandle: method.
NSString * const IMHandlePropertyAvailability; NSString * const IMHandlePropertyStatusMessage; NSString * const IMHandlePropertyAuthorizationStatus; NSString * const IMHandlePropertyIdleDate; NSString * const IMHandlePropertyAlias; NSString * const IMHandlePropertyFirstName; NSString * const IMHandlePropertyLastName; NSString * const IMHandlePropertyEmailAddress; NSString * const IMHandlePropertyPictureIdentifier; NSString * const IMHandlePropertyPictureData; NSString * const IMHandlePropertyCapabilities;
Constants
IMHandlePropertyAvailabilityThe availability of the handle. (
IMHandleAvailabilityas anNSNumber)Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandlePropertyStatusMessageThe handle’s current status message. (
NSString)Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandlePropertyAuthorizationStatusThe authorization status. (
IMHandleAuthorizationStatusas anNSNumber)Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandlePropertyIdleDateThe time of the last user activity (
NSDate).This key is applicable only for idle handles. To indicate that the time is unknown, use the value returned by the
NSDatemethoddistantPast.Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandlePropertyAliasA nicely formatted version of the handle (for example, with whitespace and capitalization).
If none is available, omit this property.
Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandlePropertyFirstNameThe first name (given name) of the handle. (
NSString)Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandlePropertyLastNameThe last name (family name) of the handle. (
NSString)Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandlePropertyEmailAddressThe email address of the handle. (
NSString)Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandlePropertyPictureIdentifierA unique identifier for the handle’s picture. (
NSString)Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandlePropertyPictureDataThe handle’s picture. (
NSData)Include this key only when responding to the
requestPictureForHandle:withIdentifier:method.Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandlePropertyCapabilitiesThe handle’s capabilities. (
NSArrayof capabilities)For a list of handle capabilities, see “Handle Capabilities”
Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.
Handle Availability
Handle availability states.
enum {
IMHandleAvailabilityUnknown = -2,
IMHandleAvailabilityOffline = -1,
IMHandleAvailabilityAway = 0,
IMHandleAvailabilityAvailable = 1
};
typedef NSInteger IMHandleAvailability;
Constants
IMHandleAvailabilityUnknownUnknown availability.
Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandleAvailabilityOfflineOffline.
Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandleAvailabilityAwayAway.
Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandleAvailabilityAvailableAvailable.
Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.
Handle Authorization Status
Authorization request statuses.
enum {
IMHandleAuthorizationStatusAccepted = 0,
IMHandleAuthorizationStatusPending = 1,
IMHandleAuthorizationStatusDeclined = 2
};
typedef NSInteger IMHandleAuthorizationStatus;
Constants
IMHandleAuthorizationStatusAcceptedRequest was accepted.
The user can see the handle’s online status.
Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandleAuthorizationStatusPendingRequest is pending.
The request has been sent and is pending approval.
Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandleAuthorizationStatusDeclinedRequest was declined.
Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.
Discussion
The IMServicePlugInGroupListAuthorizationSupport Protocol Reference and IMServiceApplicationGroupListAuthorizationSupport protocols are used to interact with authorization requests.
Handle Capabilities
Values for the IMHandlePropertyCapabilities key.
NSString * const IMHandleCapabilityMessaging; NSString * const IMHandleCapabilityOfflineMessaging; NSString * const IMHandleCapabilityChatRoom; NSString * const IMHandleCapabilityHandlePicture; NSString * const IMHandleCapabilityFileTransfer;
Constants
IMHandleCapabilityMessagingThe handle can send and receive instant messages.
Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandleCapabilityOfflineMessagingThe handle can receive instant messages when offline.
Some instant messaging services store messages that are sent to offline handles and deliver the messages when the users log back in.
Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandleCapabilityChatRoomThe handle can participate in chat rooms.
Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandleCapabilityHandlePictureThe handle can have a picture.
Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.IMHandleCapabilityFileTransferThe handle can send and receive files.
Available in OS X v10.7 and later.
Declared in
IMServicePlugInTypes.h.
© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-03-28)