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

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

Open johnnypi6 opened 4 years ago

johnnypi6 commented 4 years ago

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?

echo-branch commented 4 years ago

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?

johnnypi6 commented 4 years ago

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?

echo-branch commented 4 years ago

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

johnnypi6 commented 4 years ago

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

psilvestre-dev commented 4 years ago

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

hateshkumar commented 1 year ago

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

Kanaktechtree commented 3 days ago

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