It will be only applicable for mobile number registration and contact book synchronization.
If mobile number is used as a primary id for communication in chat sdk then there has to be sync between user and server. The following code block initiate the contact sync and let the user communicate with their contacts who uses the client app too.
Note : In order to sync mobile contacts need to enable Contact syncing using ChatManager.enableContactSync() method
Note : To access phone contacts add the Privacy - Contacts Usage Description key and proper description for contact access request value, so the ContactSyncManager class can read phone's contacts for syncing.
The progress of contact syncing can be observed using the NotificationCenter using the name of
FlyConstants.contactSyncState. From the notification's userInfo get the status of the progress using the key
FlyConstants.contactSyncState, which gives a string value which can be used as a raw value for the enum type
ContactSyncState. The code snippet below shows the show the observer and handling of contact sync progress.
Once contact sync is completed successfully,
ContactManager.shared.getRegisteredUsers() method will be called internally to fetch the profile data of the phone contacts.
Note : Remove the Observer for Contact Sync properly to avoid memory leaks.