Search code examples
androidkotlinmesibo

How to Efficiently Distinguish Between Registered and Unregistered Users Using Mesibo Contact Sync?


I'm using Mesibo.getPhoneContactsManager().start() to sync user contacts with Mesibo,also setup a custom listener to sync newly added and deleted contacts, but I can't find a straightforward way to access this synced data and distinguish between registered and unregistered users. The only method I found is Mesibo.getSortedUserProfiles, but this fetches all registered users, which seems inefficient, especially as the number of users grows.

Is there a better approach to only check which contacts are registered on Mesibo without fetching all profiles? Ideally, I would like a scalable solution that doesn’t degrade in performance as the user base increases.


Solution

  • The Mesibo.getSortedUserProfiles() API is designed to efficiently retrieve only the profiles that have been synced from the user's device using sync APIs. It does not fetch all registered users of your mesibo app, which would be impractical for large-scale applications.

    For example, if your app has millions of users, this API won't fetch all of those million profiles. Instead, it will only retrieve the profiles that correspond to contacts synced from the user's device. In most cases, phone book contacts typically number fewer than 1000, so only these matching profiles will be fetched. This ensures efficient performance and scalability as your user base grows.

    To differentiate between registered and unregistered users, you can compare the retrieved profiles against your own user records. If you have a specific use case, please describe here and we can guide you further.