Skip to main content

Recommendations

The ContactsManager SDK provides intelligent recommendation features to enhance your app’s social experience. These recommendations help users discover connections in different contexts, like finding users already using your app or suggesting people they might know.

Types of Recommendations

The SDK offers several recommendation types:
  1. Contacts to Invite: Identify contacts who would benefit from using your app
  2. App Users: Find contacts who are already using your app
  3. People You Might Know: Discover potential connections based on shared contacts

Contacts to Invite

Get a list of contacts that would be good to invite to your app:

Recommendation Scores

Each recommendation includes a score between 0.0 and 1.0 that indicates how relevant the recommendation is. Higher scores indicate stronger recommendations.

App Users

Find contacts who are already using your app:

Using Organization User IDs

The organizationUserId property allows you to connect the local contact with their server-side identity, which is useful for social features.

People You Might Know

Discover potential connections based on mutual contact information:

Building a Recommendation UI

Here’s an example of how to build a recommendations UI:

Best Practices

  1. Load Recommendations Asynchronously: Use async/await to load recommendations without blocking the UI
  2. Implement Pagination: For large contact lists, use the limit parameter to paginate results
  3. Handle Permission Changes: Reload recommendations when contact permissions change
  4. Cache Results Temporarily: Avoid excessive API calls by caching results for a short period
  5. Show Loading States: Always show appropriate loading indicators during network operations

Troubleshooting

Common Issues

  1. Empty Recommendations
    • Ensure the user has granted contacts access
    • Verify that contacts have been synced with syncContacts()
    • Check if the user has enough contacts for meaningful recommendations
  2. Missing User Information
    • Make sure contacts have proper phone numbers or email addresses
    • Ensure the server has up-to-date user information
  3. Poor Recommendation Quality
    • Increase the contacts sync frequency
    • Encourage users to complete their profiles
    • Consider implementing a feedback mechanism for recommendations