Inherits from NSObject
Declared in SCFriendList.h

Overview

SCFriendList base class provides access to the users friend list

The SCFriendList is a conveniencs class using SCDataManager fetchRequestForFriendlist: and fetchedResultsControllerWithFetchRequest: SCFriendList is a singleton instance and can be always accessed via [SCFriendList instance];

You can register a handler for added friends, removed friends and updated friends. An online status update of a friend is also causing an update event.

Class Methods

dispose

Destroys a shared instance and removed all handlers

+ (void)dispose

Declared In

SCFriendList.h

instance

Returns a shared instance of SCFriendList

+ (SCFriendList *)instance

Return Value

shared instance

Declared In

SCFriendList.h

Instance Methods

listFriendsEmail

Returns a list of email addresses of all friends

- (NSArray *)listFriendsEmail

Declared In

SCFriendList.h

listFriendsInfo

Returns a list of NSDictionary info elements of all friends

- (NSArray *)listFriendsInfo

Return Value

An array of NSDictionaries

Discussion

The dictionary contains the following keys:

Firstname       - The friends firstname
Lastname        - The friends name
Email           - The friends email address
Userid          - The friends userid
OnlineStatus    - The friends OnlineStatus
UserType        - The friends User Type (0 = normal friend, 2 = group)
CallerId        - The friends phone number for calls
DIDNumber       - The friends C2Call SDK Number
NT_WORK         - The work phone number
NT_MOBILE       - The mobile phone number
NT_HOME         - The home phone number
NT_OTHER        - Other phone number

Declared In

SCFriendList.h

listFriendsUserids

Returns a list of userids of all friends

- (NSArray *)listFriendsUserids

Declared In

SCFriendList.h

registerForAddedFriends:

Register a Block Handler if you want to be informed about new friends

- (void)registerForAddedFriends:(id)handler

Parameters

handler
  • The handler being called on new friends

Declared In

SCFriendList.h

registerForInitializationCompletion:

Register a Block Handler for initialization completion

- (BOOL)registerForInitializationCompletion:(id)handler

Parameters

handler
  • The handler being called on on initialization completion

Return Value

YES - Complete Handler is registered, NO - the data is already initialized and ready for access.

Discussion

The SCFriendList class is using core data, for accessing the friend list. Therefore the SCFriendList cannot provide any data, unless core data is initialized correctly after user login or registration. This completion handler will be called when core data is initialized and the FriendList data is available

Declared In

SCFriendList.h

registerForRemovedFriends:

Register a Block Handler if you want to be informed about removed friends

- (void)registerForRemovedFriends:(id)handler

Parameters

handler
  • The handler being called on removed friends

Declared In

SCFriendList.h

registerForUpdatedFriends:

Register a Block Handler if you want to be informed about any update to a friend

- (void)registerForUpdatedFriends:(id)handler

Parameters

handler
  • The handler being called on updated friends

Declared In

SCFriendList.h