Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch.io initSession returns empty BranchUniversalObject JSON and BranchLinkProperties JSON #184

Closed
johnnypi6 opened this issue Apr 26, 2020 · 1 comment

Comments

@johnnypi6
Copy link

johnnypi6 commented Apr 26, 2020

Hi, Many thanks for your ongoing support for the Unity community.

I'm trying to add a sharing feature to my existing app using Unity Branch SDK.
Branch SDK version 0.6.5.

I created the following deep links using the Unity Branch SDK.

https://xleague.app.link/r7DxT2wkZ5
https://xleague.app.link/4WPwY7jm05
https://xleague.app.link/LFfAOZuo05
https://xleague.app.link/hVR3fr0n05

And I retrieved BranchUniversalObject and BranchLinkProperties using the following code.

void Start()
{
    Branch.initSession(CallbackWithBranchUniversalObject);
}

void CallbackWithBranchUniversalObject(BranchUniversalObject buo, BranchLinkProperties linkProps, string error)
{
    if (error != null)
        Debug.Log($"Error : {error}");
    else
    {
        Debug.Log(buo.ToJsonString());
        Debug.Log(linkProps.ToJsonString());
        if (linkProps.controlParams.ContainsKey("$deviceID"))
        {
            string senderDeviceID = linkProps.controlParams["$deviceID"];
            ...
        }
    }
}

If I click the shared link on iPhone or Android, it will redirect me to Appstore or Google Play Store. I can install the app on the Appstore and Google Play Store.
But when I opened the app, initSession returns empty BranchUniversalObject JSON and BranchLinkProperties JSON.

BranchUniversalObject JSON
{
"$canonical_identifier": "",
"$canonical_url": "",
"$og_title": "",
"$og_description": "",
"$og_image_url": "",
"$publicly_indexable": "0",
"$locally_indexable": "0",
"$exp_date": "69425078400000",
"$keywords": [],
"metadata": "{}"
}

BranchLinkProperties JSON
{
"~tags": [],
"~feature": "",
"~alias": "",
"~channel": "",
"~stage": "",
"~duration": "0",
"control_params": {}
}

What makes me more confused is that initSession sometimes returns correct BranchUniversalObject JSON and BranchLinkProperties JSON as expected. I guess the Branch Short URL that I created only works for the first click.
I'd be much appreciated you if you could help me.

@johnnypi6
Copy link
Author

I reposted this issue.
#186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant