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 25 forks source link

Link property alias not being added to custom link generated #160

Closed hk0129 closed 5 years ago

hk0129 commented 5 years ago

Hi, Getting a short URL with Unity doesn't create a link with provided alias. Instead it always generates a different link even if an alias is provided.

` Sample Code to recreate issue

        BranchUniversalObject universalObject = new BranchUniversalObject();
        universalObject.canonicalIdentifier = "id12345";
        universalObject.canonicalUrl = "https://branch.io";
        universalObject.title = "id12345 title";
        universalObject.contentDescription = "My awesome piece of content!";
        universalObject.metadata.AddCustomMetadata("foo", "bar");
       // register a view to add to the index
        Branch.registerView(universalObject);
        BranchLinkProperties linkProperties = new BranchLinkProperties();
        linkProperties.alias = "customaliaslink
        linkProperties.tags.Add("tag1");
        linkProperties.feature = "sharing";

        Branch.getShortURL(universalObject, linkProperties, (url, error) =>
        {
            if (error != null)
            {
                Debug.LogError("Branch.getShortURL failed: " + error);
            }
            else
            {
                Debug.Log("Branch.getShortURL url: " + url);
            }
        });

`

I've identified the cause for this issue and will be making a PR asap. Thank you.

antonargunov commented 5 years ago

@hdjay0129 thanks for the report! we will add the fix in Unity SDK asap.