unity-branch-deep-linking-attribution icon indicating copy to clipboard operation
unity-branch-deep-linking-attribution copied to clipboard

Branch IO Deep Linking works only after I clear the Safari history and cache data on iOS

Open johnnypi6 opened this issue 5 years ago • 7 comments

I'm trying to add a sharing feature to my existing app using Unity Branch SDK. I retrieve custom data from initSession function of Branch SDK (Unity).

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

void CallbackWithBranchUniversalObject(BranchUniversalObject buo,
                                    BranchLinkProperties linkProps,
                                    string error)
{
    string senderDeviceID = linkProps.controlParams["$deviceID"];
}

But initSession function seems to work a few times but it returns empty BranchUniversalObject JSON and BranchLinkProperties JSON after that. After a few days of struggling, I found that Safari history and cache data causes the issue. When I clear the Safari history and cache data, initSession function works again as I expected and I can retrieve custom data from Branch deep link.

How do Safari history and cache data affect the Branch deep link? What should I do to fix the problem of empty BranchUniversalObject JSON and BranchLinkProperties JSON?

johnnypi6 avatar May 06 '20 16:05 johnnypi6

Logging a ticket to see if we can repro the issue you're seeing. Could you provide what version of the SDK you're using along with some information about the device you're seeing this on? Also are you seeing the same issue on all test devices?

echo-branch avatar May 06 '20 20:05 echo-branch

Thank you for your kind reply.

Branch Unity SDK version: 0.6.5

Test Devices

Device Name: iPad Air2 iOS version: 13.4.1

I used the following code to generate a deep link.

public static void GenerateShortURL(BranchManagerCallbackWithShortUrl callback = null)
{
    BranchUniversalObject universalObject = new BranchUniversalObject();
    BranchLinkProperties linkProperties = new BranchLinkProperties();
    string deviceUniqueIdentifier = SystemInfo.deviceUniqueIdentifier;
    
    universalObject.canonicalIdentifier = "xLeagueShareLink";
    universalObject.canonicalUrl = "http://xleague.games/";
    universalObject.title = MetaDataManager.Title;
    universalObject.contentDescription = MetaDataManager.Description;
    universalObject.imageUrl = MetaDataManager.Image;
    universalObject.contentIndexMode = 0;
    universalObject.localIndexMode = 0;

    Branch.registerView(universalObject);

    linkProperties.feature = "sharing";
    linkProperties.controlParams.Add("$desktop_url", "http://xleague.games/xleague-solitaire-share/");
    linkProperties.controlParams.Add("$android_url", "http://xleague.games/android");
    linkProperties.controlParams.Add("$ios_url", "https://apps.apple.com/us/app/xleague-solitaire/id1480117114");
    linkProperties.controlParams.Add("$ipad_url", "https://apps.apple.com/us/app/xleague-solitaire/id1480117114");
    linkProperties.controlParams.Add("$og_title", MetaDataManager.Title);
    linkProperties.controlParams.Add("$og_description", MetaDataManager.Description);
    linkProperties.controlParams.Add("$og_image_url", MetaDataManager.Image);
    linkProperties.controlParams.Add("$deviceID", deviceUniqueIdentifier);

    Debug.Log("Starting get short URL...");

    Branch.getShortURL(universalObject, linkProperties, (param, error) =>
    {
        callback(param, error);
    });
}

Would you please help me?

johnnypi6 avatar May 06 '20 21:05 johnnypi6

Thanks for the information! I'm hoping to devote the next sprint to working through github issues.

echo-branch avatar May 06 '20 21:05 echo-branch

Please let me know if you need any other information to resolve this issue.

johnnypi6 avatar May 06 '20 21:05 johnnypi6

Hi, I'm facing the same issue... do we know if the fix is prioritized to be in the roadmap? Thanks!

psilvestre-dev avatar Jul 02 '20 11:07 psilvestre-dev

Hi, does anyone has found any kinda of solution for this? I am still facing an issues

hateshkumar avatar Nov 14 '23 14:11 hateshkumar