1

I've finally succeeded on implementing the dynamic link (manually created and the shortened by the Rest API), that works fine and opens the game when clicked.

The thing is, once opened, I can't retrieve anything from it. I've copied the example code from the documentation, added some logs, and nothing.

Here is my code,

// When the app starts, check to make sure that we have
// the required dependencies to use Firebase, and if not,
// add them if possible.
void Start()
{
    dependencyStatus = Firebase.FirebaseApp.CheckDependencies();
    if (dependencyStatus != Firebase.DependencyStatus.Available)
    {
        Firebase.FirebaseApp.FixDependenciesAsync().ContinueWith(task => {
            dependencyStatus = Firebase.FirebaseApp.CheckDependencies();
            if (dependencyStatus == Firebase.DependencyStatus.Available)
            {
                InitializeFirebase();
            } else
            {
                Debug.LogError("Could not resolve all Firebase dependencies: " + dependencyStatus);
            }
        });
    } else {
        InitializeFirebase();
    }
}

// Set the listeners for the various Invite received events.
void InitializeFirebase()
{
    Firebase.Invites.FirebaseInvites.InviteReceived += OnInviteReceived;
    Firebase.Invites.FirebaseInvites.InviteNotReceived += OnInviteNotReceived;
    Firebase.Invites.FirebaseInvites.ErrorReceived += OnErrorReceived;
    Debug.Log("Invites initialized");
}

void OnInviteReceived(object sender, Firebase.Invites.InviteReceivedEventArgs e)
{
    Debug.Log ("OnInviteRecieved");
    if (e.InvitationId != "")
    {
        Debug.Log("Invite received: Invitation ID: " + e.InvitationId);
        Firebase.Invites.FirebaseInvites.ConvertInvitationAsync(e.InvitationId).ContinueWith(HandleConversionResult);
    }
    if (e.DeepLink.ToString () != "")
    {
        Debug.Log ("Invite received: Deep Link: " + e.DeepLink);
        PrepareLevel (e.DeepLink.ToString ());
    }
}

void OnInviteNotReceived(object sender, System.EventArgs e)
{
    Debug.Log ("OnInviteNotReceived");
    Debug.Log("No Invite or Deep Link received on start up");
}

void OnErrorReceived(object sender, Firebase.Invites.InviteErrorReceivedEventArgs e)
{
    Debug.Log ("OnErrorReceived");
    Debug.LogError("Error occurred received the invite: " + e.ErrorMessage);
}

void HandleConversionResult(Task convertTask)
{
    Debug.Log ("HandleConversionResult");
    if (convertTask.IsCanceled) {
        Debug.Log("Conversion canceled.");
    } else if (convertTask.IsFaulted) {
        Debug.Log("Conversion encountered an error:");
        Debug.Log(convertTask.Exception.ToString());
    } else if (convertTask.IsCompleted) {
        Debug.Log("Conversion completed successfully!");
    }
}

And here is the logs I get from the device (iPhone6S).

execution_logs

Also, "Invites initialized" has been prompted, and the object still exist when the app is opened from the dynamic link (it's never destroyed).

Oh, and I oppened the link via facebook messenger app.

All help will be greatly appreciated.

Carles
  • 451
  • 5
  • 16
  • Having the same problem. I followed the iOS docs and compared with Unity's app delegate and found that the entry point is missing: - (BOOL) application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray * _Nullable))restorationHandler If I add this, I get the incoming URL (in Obj-C). I can then forward it to Unity, but I hardly think it's supposed to be that way - should the SDK not handle this automatically? – N.J. Apr 29 '17 at 12:21
  • Its good to hear that I'm not the only one with this issue. I already contacted with the Firebase support team, they will hopefully provide the answer if something is missing or a fix in the upcoming release. Best! – Carles Apr 30 '17 at 12:47

0 Answers0