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:- Contacts to Invite: Identify contacts who would benefit from using your app
- App Users: Find contacts who are already using your app
- 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
TheorganizationUserId
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
- Load Recommendations Asynchronously: Use async/await to load recommendations without blocking the UI
- Implement Pagination: For large contact lists, use the
limit
parameter to paginate results - Handle Permission Changes: Reload recommendations when contact permissions change
- Cache Results Temporarily: Avoid excessive API calls by caching results for a short period
- Show Loading States: Always show appropriate loading indicators during network operations
Troubleshooting
Common Issues
-
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
-
Missing User Information
- Make sure contacts have proper phone numbers or email addresses
- Ensure the server has up-to-date user information
-
Poor Recommendation Quality
- Increase the contacts sync frequency
- Encourage users to complete their profiles
- Consider implementing a feedback mechanism for recommendations