QNAddressBooksRepository

public class QNAddressBooksRepository

Service to manage contact actions and subscribe to contact events

  • Sources from which the contacts will be fetched

    • contacts
    • phonebooks
    • domain
    • static
    • groups

    Declaration

    Swift

    public enum Source : String

Properties

Api

  • Fetch all contacts filtered by source

    Declaration

    Swift

    public func getContacts(using sources: [QNAddressBooksRepository.Source],
                            fromCache: Bool = true,
                            result: @escaping (Result<[QNContact], QNSDKError>) -> Void)

    Parameters

    using

    Sources from which the contacts will be fetched

    fromCache

    Retrieve from cache or server; true by default

    result

    Result with the list of Contacts

  • Add a new contact

    Declaration

    Swift

    public func add(contact: QNContact, result: @escaping (Result<QNContact, QNSDKError>) -> Void)

    Parameters

    contact

    Contact to create

    result

    Result with new Contact

  • Update a contact

    Declaration

    Swift

    public func update(contact: QNContact, result: @escaping (Result<QNContact, QNSDKError>) -> Void)

    Parameters

    contact

    Contact to update

    result

    Result with updated Contact

  • Remove a contact

    Declaration

    Swift

    public func delete(contact: QNContact, result: @escaping (Result<Void, QNSDKError>) -> Void)

    Parameters

    contact

    Contact to remove