ContactProvider lets you build an app extension that supplies contact items from a custom contact database on iOS. You conform to ContactProviderExtension and define a ContactProviderDomain, enumerate items through ContactItemEnumerating and ContactItemEnumerator returning a ContactItemPage, and track changes against a ContactItemSyncAnchor. To surface updates, you implement ContactItemChangeObserver and ContactItemContentObserver, while ContactProviderManager coordinates the extension and ContactProviderError reports failures.
Essentials 3
Conform to the extension and domain protocols that anchor a custom contact provider.
- PrContactProviderExtensionThe extension `@main` class implements this protocol.
- PrContactProviderDomainA domain, including traits like an identifier and display name, used to configure the extension.
- StDefaultContactProviderDomainThe default domain the extension uses.
Coordinating the Extension 1
Use the manager to register and coordinate your contact provider extension with the system.
- ClContactProviderManagerAn interface for the app to control its extension.
Enumerating Contact Items 4
Enumerate contact items from your custom database in paged batches.
- PrContactItemEnumeratingA protocol to provide enumerators for collections of contact items.
- PrContactItemEnumeratorA protocol to provide enumerations of all contact items and changed contact items.
- StContactItemPageA fixed offset into enumerating all contact items.
- EnContactItemAn item in the contact database.
Tracking and Observing Changes 3
Track sync state and observe content and change updates to keep contacts current.
- StContactItemSyncAnchorA snapshot point into enumerating changed contact items.
- PrContactItemChangeObserverA protocol that defines a system observer that receives a resumable enumeration of changed contact items.
- PrContactItemContentObserverA protocol that defines a system observer that receives a resumable enumeration of all items.
Errors 1
Handle failures reported by the contact provider.
- EnContactProviderErrorErrors thrown by the Contact Provider framework.