Search code examples
androidkotlinmesibo

How to manually sync Mesibo Phone Contacts


I want to create manual contact sync button like whatsapp, I use Mesibo.getPhoneContactsManager().start() from sample code, how to check sync status, is in process, failed or done, and how to get the latest synced contact list ?


Solution

  • Please refer to the documentation here

    https://docs.mesibo.com/api/phone-contacts-and-addressbook/monitoring-and-synchronization/

    You can implement a listener which can give you status as it syncs

    boolean Mesibo_onPhoneContactsAdded(String[] phoneNumbers){
    
    
        return true;
    }
    

    If you prefer to syncronize manually, refer to the syncronization documetation here

    https://docs.mesibo.com/api/users-and-profiles/contact-management-and-profile-synchronization/

    For example, use code below is iOS to synchronize following contacts manually.

    String[] contacts = {"18005550001", "18005550002", "18005550003"};
    
    MesiboContactSynchronizer *syncer = new MesiboContactSynchronizer();
    syncer.subscribe(true);
    syncer.setProfileAccessLevels([1,2,5]);
    syncer.sync(contacts, true);