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 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);
    }

-Advertisement-

Tagged in : Android

Join The Discussion

Please note: We reserve the right to delete comments that contains snarky remarks, offensive or off-topic. To know more read our comments policy.