BranchMetrics / unity-branch-deep-linking-attribution

The Branch Unity SDK for deep linking and attribution. Branch helps mobile apps grow with deep links / deeplinks that power paid acquisition and re-engagement campaigns, referral programs, content sharing, deep linked emails, smart banners, custom user onboarding, and more.
https://docs.branch.io/apps/unity/
MIT License
118 stars 24 forks source link

Firebase SDK is not working with Branch SDK. (ios only) #214

Open ForJobOk opened 4 months ago

ForJobOk commented 4 months ago

Describe the bug

I tried using Branch Unity SDK with FirebaseSDK, but firebase dynamic links can not receive callback.

void Start()
{
    if (Application.isEditor) return;
    DynamicLinks.DynamicLinkReceived += (sender, eventArgs) =>
    {
        var link = eventArgs?.ReceivedDynamicLink.Url.OriginalString;
        Debug.Log("FDL: " + link);
    };

    Branch.initSession(CallbackWithBranchUniversalObject);
}

private void CallbackWithBranchUniversalObject(
    BranchUniversalObject buo,
    BranchLinkProperties linkProps,
    string error)
{
    if (error != null)
    {
        Debug.LogError("Error on CallbackWithBranchUniversalObject: " + error);
    }

    Debug.Log("Branch: " + buo.ToJsonString());
}

I predicted that our project is wrong or conflict some functions, but reproduced on your sample repository.

When I do comment out IMPL_APP_CONTROLLER_SUBCLASS in BranchAppController.mm, correctly woking firebase dynamic links. Of course, in case of that, not working Branch's Quick Links.

How can I use those in a same unity project?

verison info

Steps to reproduce

  1. Clone your project.
  2. Add Branch SDK
  3. Add Firebase SDK
  4. Build

Expected behavior

Receive a velue on lunch an app at Firebase and Branch.

SDK Version

1.0.0

Unity Version

2022.3.3f1

Make and Model

iPhone14

OS

ios 17.4.1

Additional Information/Context

No response