Find Friends (Deprecated)


Find Friends provided by Digits is not being migrated to Firebase Auth and will no longer work effective September 30th. For more information, please see our FAQ and migration guide.

Using the Find Friends feature, users can upload their address book to find other Digits users in your app that they know. If you want to allow users to Invite Friends to your app, please see Invite Friends (Deprecated).

Getting Started

You must include the android.permission.READ_CONTACTS permission in your manifest. Without this Digits will be unable to access the user’s address book.

To start the Find Friends process call the uploadContacts method on the Digits instance. You can optionally define Digits with a custom theme for the upload flow.


The first time uploadContacts is called a dialog requesting permission to upload the user’s address book will be displayed.


Once the user clicks “Okay” the address book will be upload in the background using an IntentService.

Getting Results

Once complete the contacts upload service will broadcast an Intent with the action value for success or for failure. On success the Intent will contain an extra value with additional information. You can create a BroadcastReceiver to receive the Intent and perform some action.

public class MyResultReceiver extends BroadcastReceiver {
  public void onReceive(Context context, Intent intent) {
    if (ContactsUploadService.UPLOAD_COMPLETE.equals(intent.getAction())) {
      ContactsUploadResult result = intent

      // Post success notification
    } else {
      // Post failure notification

Don’t forget to add your BroadcastReceiver to the application manifest.

    <action android:name=""/>
    <action android:name=""/>

Results can be retrieved by calling findFriends method.

Digits.findFriends(new ContactsCallback<Contacts>() {

    public void success(Result<Contacts> result) {
      if ( != null) {
        // Process data

    public void failure(TwitterException exception) {
      // Show error


See the sample app’s Digits Main Activity for example usage.


Call uploadContacts with an activity request id to bind a request code to the activity result.

public static final int CONTACT_UPLOAD_REQUEST = 2;
// ...
// ...
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == CONTACT_UPLOAD_REQUEST && resultCode == RESULT_CANCELED) {
      // ...