Mac Developer Library

Developer

IMServicePlugIn Framework Reference IMServicePlugIn Protocol Reference

Options
Deployment Target:

On This Page
Language:

IMServicePlugIn

The principal class for each service plug-in must implement the IMServicePlugIn protocol. Implementing this protocol indicates that your service plug-in instance can perform basic tasks such as logging in, logging out, and updating account settings.

Inheritance


Not Applicable

Import Statement


import IMServicePlugIn @import IMServicePlugIn;

Availability


Available in OS X v10.7 and later.
  • Initializes your service plug-in. (required)

    Declaration

    Swift

    init!(serviceApplication client: IMServiceApplication!)

    Objective-C

    - (id)initWithServiceApplication:(id<IMServiceApplication>)client

    Parameters

    client

    The client interface, used to communicate with the instant messaging client.

    Discussion

    When your plug-in is loaded, this method is called to pass it a client object. For each optional plug-in protocol that your service plug-in implements, the client object implements the corresponding application protocol.

    Import Statement

    import IMServicePlugIn

    Availability

    Available in OS X v10.7 and later.

  • login() login Required

    Logs in to the instant messaging service. (required)

    Declaration

    Swift

    func login()

    Objective-C

    - (oneway void)login

    Discussion

    To indicate that the user successfully logged in, call the plugInDidLogIn method on the client object.

    To indicate a login failure:

    Import Statement

    import IMServicePlugIn

    Availability

    Available in OS X v10.7 and later.

  • logout() logout Required

    Logs out of the instant messaging service. (required)

    Declaration

    Swift

    func logout()

    Objective-C

    - (oneway void)logout

    Discussion

    To indicate that the user logged out, call the plugInDidLogOutWithError:reconnect: method on the client object, including any appropriate error information.

    Import Statement

    import IMServicePlugIn

    Availability

    Available in OS X v10.7 and later.

  • Updates the account settings. (required)

    Declaration

    Swift

    func updateAccountSettings(_ accountSettings: [NSObject : AnyObject]!)

    Objective-C

    - (oneway void)updateAccountSettings:(NSDictionary *)accountSettings

    Parameters

    accountSettings

    A dictionary containing the account settings. For a list of keys, see Account Setting Keys.

    Discussion

    The instant messaging client calls this method prior to logging in with the user's account settings.

    Import Statement

    import IMServicePlugIn

    Availability

    Available in OS X v10.7 and later.

  • These keys are used by the updateAccountSettings: method.

    Declaration

    Swift

    let IMAccountSettingServerHost: NSString! let IMAccountSettingServerPort: NSString! let IMAccountSettingLoginHandle: NSString! let IMAccountSettingPassword: NSString! let IMAccountSettingUsesSSL: NSString!

    Objective-C

    NSString * const IMAccountSettingServerHost; NSString * const IMAccountSettingServerPort; NSString * const IMAccountSettingLoginHandle; NSString * const IMAccountSettingPassword; NSString * const IMAccountSettingUsesSSL;

    Constants

    • IMAccountSettingServerHost

      IMAccountSettingServerHost

      The host name of the server.

      The value for this key is stored as an NSString object.

      Available in OS X v10.7 and later.

    • IMAccountSettingServerPort

      IMAccountSettingServerPort

      The port number of the server.

      The value for this key is stored as an NSNumber object.

      Available in OS X v10.7 and later.

    • IMAccountSettingLoginHandle

      IMAccountSettingLoginHandle

      The user’s handle.

      The value for this key is stored as an NSString object.

      Available in OS X v10.7 and later.

    • IMAccountSettingPassword

      IMAccountSettingPassword

      The user’s password.

      The value for this key is stored as an NSString object.

      Available in OS X v10.7 and later.

    • IMAccountSettingUsesSSL

      IMAccountSettingUsesSSL

      Whether to use SSL.

      The value for this key is a Boolean, stored as an NSNumber object.

      Available in OS X v10.7 and later.

    Import Statement