Firebase Invites are an out-of-the-box solution for app referrals and sharing via email or SMS. Firebase Android SDK allows you to send and receive invites from an Android application.

Build an Intent to launch the invitation Activity to create and send invitations. The Intent returned from build() should be used to start the Activity using startActivityForResult(android.content.Intent, int).

public static void sendFirebaseInvite(Activity activity, int requestCode) {
        Intent intent = new AppInviteInvitation.IntentBuilder(activity.getString(R.string.invitation_title))
                .setMessage(activity.getString(R.string.invitation_message))
                .setDeepLink(Uri.parse(activity.getString(R.string.invitation_deep_link)))
                .setCustomImage(Uri.parse(activity.getString(R.string.invitation_custom_image)))
                .setCallToActionText(activity.getString(R.string.invitation_cta))
                .build();
        activity.startActivityForResult(intent, requestCode);
    }