Firebase.Invites.FirebaseInvites

FirebaseInvites API.

Summary

FirebaseInvites is a cross-platform solution for sending personalized email and SMS invitations, on-boarding users, and measuring the impact of invitations or dynamic links.

Events

ErrorReceived
static System.EventHandler< InviteErrorReceivedEventArgs >
Called when an error occurs trying to fetch the invitation information.
InviteNotReceived
static System.EventHandler
Called when there was no invitation or dynamic link used to open the app.
InviteReceived
static System.EventHandler< InviteReceivedEventArgs >
Called on the client when an invite arrives.

Public static functions

ConvertInvitationAsync(string invitationId)
Mark the invitation as "converted" in some app-specific way.
SendInviteAsync(Invite invite)
Start displaying the invitation UI, which will ultimately result in sending zero or more invitations.

Events

ErrorReceived

static System.EventHandler< InviteErrorReceivedEventArgs > ErrorReceived

Called when an error occurs trying to fetch the invitation information.

InviteNotReceived

static System.EventHandler InviteNotReceived

Called when there was no invitation or dynamic link used to open the app.

InviteReceived

static System.EventHandler< InviteReceivedEventArgs > InviteReceived

Called on the client when an invite arrives.

Public static functions

ConvertInvitationAsync

System.Threading.Tasks.Task ConvertInvitationAsync(
  string invitationId
)

Mark the invitation as "converted" in some app-specific way.

Once you have acted on the invite in some application-specific way, you can call this function to tell Firebase that a "conversion" has occurred and the invite has been acted on in some significant way.

You don't need to convert immediately when it received, since a "conversion" can happen far in the future from when the invite was initially received, e.g. if it corresponds to the user setting up an account, making a purchase, etc.

Just save the invitation ID when you initially receive it, and use it later when performing the conversion.

Usage:

public void OnInviteReceived(object sender,
                             Firebase.Invites.InviteReceivedEventArgs e) {
  Firebase.Invites.FirebaseInvites.ConvertInvitationAsync(
    e.InvitationID).ContinueWith((convertTask) => {
      if (convertTask.IsCanceled) {
         DebugLog("Conversion canceled.");
      } else if (convertTask.IsFaulted) {
         DebugLog("Conversion encountered an error:");
         DebugLog(convertTask.Exception.ToString());
      } else if (convertTask.IsCompleted) {
        DebugLog("Conversion completed successfully!");
      }
    });
}

Details
Parameters
invitationId
The invitation ID to mark as a conversion. A future result telling you whether the conversion succeeded.

SendInviteAsync

System.Threading.Tasks.Task< SendInviteResult > SendInviteAsync(
  Invite invite
)

Start displaying the invitation UI, which will ultimately result in sending zero or more invitations.

This will take the invitation settings from the given Invite object, and display a UI to the user where they can share a link to the app with their friends.

At a minimum, you will need to have set title_text and message_text or the invitation will not be sent.

Usage:

Firebase.Invites.Invite invite = new Firebase.Invites.Invite() {
  TitleText = "Invites Test App",
  MessageText = "Please try my app! It's awesome.",
  CallToActionText = "Download it for FREE",
  DeepLinkUrl = new System.Uri("http://google.com/abc"),
};
Firebase.Invites.FirebaseInvites.SendInviteAsync(invite).ContinueWith(
  (sendTask) => {
    if (sendTask.IsCanceled) {
      DebugLog("Invitation canceled.");
    } else if (sendTask.IsFaulted) {
      DebugLog("Invitation encountered an error:");
      DebugLog(sendTask.Exception.ToString());
    } else if (sendTask.IsCompleted) {
      DebugLog("SendInvite: " +
      (new List(sendTask.Result.InvitationIDs)).Count +
      " invites sent successfully.");
      foreach (string id in sendTask.Result.InvitationIDs) {
        DebugLog("SendInvite: Invite code: " + id);
    }
  });

Details
Parameters
invite
The Invite that contains the settings to send with. A future result telling us whether the invitation was sent.

Send feedback about...

Need help? Visit our support page.