FriendList

public class FriendList : LinphoneObject

This object representing a list of Friend. You can use it to store contacts locally or synchronize them through CardDAV protocol.

  • Undocumented

    Declaration

    Swift

    public static func getSwiftObject(cObject: OpaquePointer) -> FriendList
  • Undocumented

    Declaration

    Swift

    public var getCobject: OpaquePointer? { get }
  • Enum describing the status of a CardDAV synchronization.

    See more

    Declaration

    Swift

    public enum SyncStatus : Int
  • Enum describing the status of a LinphoneFriendList operation.

    See more

    Declaration

    Swift

    public enum Status : Int
  • Undocumented

    Declaration

    Swift

    public func addDelegate(delegate: FriendListDelegate)
  • Undocumented

    Declaration

    Swift

    public func removeDelegate(delegate: FriendListDelegate)
  • Returns the Core object attached to this LinphoneFriendList.

    Declaration

    Swift

    public var core: Core? { get }

    Return Value

    a Core object

  • Get the current LinphoneFriendListCbs object associated with a LinphoneFriendList.

    Declaration

    Swift

    public var currentDelegate: FriendListDelegate? { get }

    Return Value

    The current LinphoneFriendListCbs object associated with the LinphoneFriendList.

  • Set the display name of the friend list.

    Declaration

    Swift

    public var displayName: String { get set }

    Parameters

    displayName

    The new display name of the friend list.
    Get the display name of the friend list.

    Return Value

    The display name of the friend list.

  • Retrieves the list of Friend from this LinphoneFriendList.

    Declaration

    Swift

    public var friends: [Friend] { get }

    Return Value

    A list of Friend

  • Get wheter the subscription of the friend list is bodyless or not.

    Declaration

    Swift

    public var isSubscriptionBodyless: Bool { get }

    Return Value

    Wheter the subscription of the friend list is bodyless or not.

  • Set the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence.

    Declaration

    Swift

    public var rlsAddress: Address? { get set }

    Parameters

    rlsAddr

    The RLS URI to associate with the friend list.
    Get the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence.

    Return Value

    The RLS URI as Address associated with the friend list.

  • Set the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence.

    • deprecated: 27/10/2020. Use setRlsAddress() instead. Get the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence.
    • deprecated: 27/10/2020. Use getRlsAddress() instead.

    Declaration

    Swift

    public var rlsUri: String { get set }

    Parameters

    rlsUri

    The RLS URI to associate with the friend list.

    Return Value

    The RLS URI associated with the friend list.

  • Set wheter the subscription of the friend list is bodyless or not.

    Declaration

    Swift

    public var subscriptionBodyless: Bool? { get set }

    Parameters

    bodyless

    boolean telling if the subscription of the friend list is bodyless or not.

  • Enable subscription to NOTIFYes of all friends list.

    Declaration

    Swift

    public var subscriptionsEnabled: Bool { get set }

    Parameters

    enabled

    should subscription be enabled or not Gets whether subscription to NOTIFYes of all friends list are enabled or not.

    Return Value

    Whether subscriptions are enabled or not

  • Assign a friend list type to the friend list.

    Declaration

    Swift

    public var type: FriendListType { get set }

    Parameters

    type

    LinphoneFriendListType to assing Get the type of a friend list.

  • uri

    Set the URI associated with the friend list.

    Declaration

    Swift

    public var uri: String { get set }

    Parameters

    uri

    The URI to associate with the friend list.
    Get the URI associated with the friend list.

    Return Value

    The URI associated with the friend list.

  • Assign a user pointer to the friend list.

    Declaration

    Swift

    public var userData: UnsafeMutableRawPointer? { get set }

    Parameters

    userData

    The user pointer to associate with the friend list.
    Retrieve the user pointer associated with the friend list.

    Return Value

    The user pointer associated with the friend list.

  • Add a friend to a friend list. If or when a remote CardDAV server will be attached to the list, the friend will be sent to the server.

    Declaration

    Swift

    public func addFriend(linphoneFriend: Friend) -> FriendList.Status

    Parameters

    linphoneFriend

    Friend object to add to the friend list.

    Return Value

    OK if successfully added, InvalidFriend if the friend is not valid.

  • Add a friend to a friend list. The friend will never be sent to a remote CardDAV server. Warning!

    LinphoneFriends added this way will be removed on the next synchronization,

    and the callback contact_deleted will be called.

    Declaration

    Swift

    public func addLocalFriend(linphoneFriend: Friend) -> FriendList.Status

    Parameters

    linphoneFriend

    Friend object to add to the friend list.

    Return Value

    OK if successfully added, InvalidFriend if the friend is not valid.

  • Creates and export Friend objects from FriendList to a file using vCard 4 format.

    Declaration

    Swift

    public func exportFriendsAsVcard4File(vcardFile: String)

    Parameters

    vcardFile

    the path to a file that will contain the vCards

  • Find a friend in the friend list using a LinphoneAddress.

    Declaration

    Swift

    public func findFriendByAddress(address: Address) -> Friend?

    Parameters

    address

    Address object of the friend we want to search for.

    Return Value

    A Friend if found, nil otherwise.

  • Find a friend in the friend list using a phone number.

    Declaration

    Swift

    public func findFriendByPhoneNumber(phoneNumber: String) -> Friend?

    Parameters

    phoneNumber

    a string of the phone number for which we want to find a friend.

    Return Value

    A Friend if found, nil otherwise.

  • Find a friend in the friend list using a ref key.

    Declaration

    Swift

    public func findFriendByRefKey(refKey: String) -> Friend?

    Parameters

    refKey

    The ref key string of the friend we want to search for.

    Return Value

    A Friend if found, nil otherwise.

  • Find a friend in the friend list using an URI string.

    Declaration

    Swift

    public func findFriendByUri(uri: String) -> Friend?

    Parameters

    uri

    A string containing the URI of the friend we want to search for.

    Return Value

    A Friend if found, nil otherwise.

  • Find all friends in the friend list using a LinphoneAddress.

    Declaration

    Swift

    public func findFriendsByAddress(address: Address) -> [Friend]

    Parameters

    address

    Address object of the friends we want to search for.

    Return Value

    A list of Friend if found, nil otherwise.

  • Find all friends in the friend list using an URI string.

    Declaration

    Swift

    public func findFriendsByUri(uri: String) -> [Friend]

    Parameters

    uri

    A string containing the URI of the friends we want to search for.

    Return Value

    A list of Friend if found, nil otherwise.

  • Creates and adds Friend objects to FriendList from a buffer that contains the vCard(s) to parse.

    Declaration

    Swift

    public func importFriendsFromVcard4Buffer(vcardBuffer: String) -> Int

    Parameters

    vcardBuffer

    the buffer that contains the vCard(s) to parse

    Return Value

    the amount of linphone friends created

  • Creates and adds Friend objects to FriendList from a file that contains the vCard(s) to parse.

    Declaration

    Swift

    public func importFriendsFromVcard4File(vcardFile: String) -> Int

    Parameters

    vcardFile

    the path to a file that contains the vCard(s) to parse

    Return Value

    the amount of linphone friends created

  • Notify our presence to all the friends in the friend list that have subscribed to our presence directly (not using a RLS).

    Declaration

    Swift

    public func notifyPresence(presence: PresenceModel)

    Parameters

    presence

    PresenceModel object.

  • Remove a friend from a friend list.

    Declaration

    Swift

    public func removeFriend(linphoneFriend: Friend) -> FriendList.Status

    Parameters

    linphoneFriend

    Friend object to remove from the friend list.

    Return Value

    OK if removed successfully, NonExistentFriend if the friend is not in the list.

  • Starts a CardDAV synchronization using value set using linphone_friend_list_set_uri.

    Declaration

    Swift

    public func synchronizeFriendsFromServer()
  • Goes through all the Friend that are dirty and does a CardDAV PUT to update the server.

    Declaration

    Swift

    public func updateDirtyFriends()
  • Sets the revision from the last synchronization.

    Declaration

    Swift

    public func updateRevision(revision: Int)

    Parameters

    revision

    The revision

  • Update presence subscriptions for the entire list. Calling this function is necessary when list subscriptions are enabled, ie when a RLS presence server is used.

    Declaration

    Swift

    public func updateSubscriptions()