Development environment:
Turn TestMode to true to simulate new installations in a developer environment.
<meta-data android:name="io.branch.sdk.TestMode" android:value="true" />
Set up your iOS / Android app
Android: https://docs.branch.io/pages/apps/android/
IOS: https://docs.branch.io/pages/apps/ios/
optional:
- Make sure that you have configured the io-link branching parameters in the console correctly.

- Get your parameters with the correct key name that you defined in your list of parameters in link management.
JSONObject sessionParams = Branch.getInstance().getLatestReferringParams(); sessionParams.has("paramName")
Start a branch session:
Branch branch = Branch.getInstance(); // Branch init branch.initSession(new Branch.BranchReferralInitListener() { @Override public void onInitFinished(JSONObject referringParams, BranchError error) { if (error == null) { Log.e("BRANCH SDK", referringParams.toString()); // latest JSONObject sessionParams = Branch.getInstance().getLatestReferringParams(); Log.e("sessions params :", sessionParams.toString()); // first JSONObject installParams = Branch.getInstance().getFirstReferringParams(); Log.e("install params :", installParams.toString()); processDeepLinkParams(sessionParams); if (getIntent().getExtras() != null && getIntent().getExtras().keySet() != null) { deepLinkinData = getIntent().getExtras().getString("branch_data"); } // Branch logging for debugging // Branch.enableLogging(); } else { Log.i("BRANCH SDK", error.getMessage()); } } }, this.getIntent().getData(), this);
source share