I'm trying to add Firebase Invites to my Unity game. I've followed all the tutorial steps and have set up seems like everything. But when I try to run the code from tutorial to send an invite, I'm getting an exception:
ApplicationException: internal::IsInitialized()
at Firebase.FutureBase.status ()
at Firebase.Invites.SendInviteFuture.GetTask (Firebase.Invites.SendInviteFuture fu)
at Firebase.Invites.FirebaseInvites.SendInviteAsync (Firebase.Invites.Invite invite)
...
The code is:
void Start()
{
Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task =>
{
dependencyStatus = task.Result;
if (dependencyStatus == Firebase.DependencyStatus.Available)
InitializeFirebase();
else
Debug.LogError("Could not resolve all Firebase dependencies: " + dependencyStatus);
});
}
void InitializeFirebase()
{
Firebase.Invites.FirebaseInvites.InviteReceived += OnInviteReceived;
Firebase.Invites.FirebaseInvites.InviteNotReceived += OnInviteNotReceived;
Firebase.Invites.FirebaseInvites.ErrorReceived += OnErrorReceived;
}
public void ShowInviteBox(System.Action<bool> callback)
{
var 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(HandleSentInvite);
}
I use:
- Unity 2017.3.0f3
- Google Play Game Services Plugin for Unity 0.9.50
- Firebase Invites 4.4.3
- Appodeal 2.8.18 nodex
- Game Analytics 3.10.4
Any help would be highly appreciated!