Search code examples
deep-linkingbranch.io

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


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"];
}

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?


Solution

  • Uninstalling and reinstalling the app several times often results in browser cache not refreshing as per the App's current state. Please check on the AASA file for the current state on the device as well : https://help.branch.io/developers-hub/docs/ios-troubleshooting#section-validate-if-aasa-file-successfully-downloaded

    A possible solution here :

    1. Uninstall app
    2. Clear browser cache
    3. Restart device
    4. Reinstall App

    You can submit your query here as well.