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

SDK-1818 update sdk versions and SDK-1817 unity branch.json support #207

Closed echo-branch closed 1 year ago

echo-branch commented 1 year ago

Reference

SDK-1818 and SDK-1817

Summary

Add support for delayed native init to account for slow C# runtime startup.

Motivation

Platforms such as Unity and React Native startup slowly compared to native code. This can result in install events that happen prior to any client C# code being run. We've added a startup cache that delays init until the C# notifies the underlying SDK that it's ready.

The branch.json fix also allows logging to be enabled via config rather than in native code.

Type Of Change

Testing Instructions

In your test app add Assets/StreamingAssets/branch.json

{
  "enableLogging": true,
  "deferInitForPluginRuntime": true
}

In your C# code add the following prior to init.

        Branch.setRequestMetadata("something", "test");
        Branch.initSession(CallbackWithBranchUniversalObject);

Prior to this update, the install event will not include the request metadata set here. While the updated code will include the metadata.

cc @BranchMetrics/saas-sdk-devs for visibility.