Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Add this to your main Activity file:
- @Override
- public void onStart() {
- super.onStart();
- Branch branch = Branch.getInstance();
- // Branch init
- branch.initSession(new Branch.BranchReferralInitListener() {
- @Override
- public void onInitFinished(JSONObject referringParams, BranchError error) {
- if (error == null) {
- // params are the deep linked params associated with the link that the user clicked -> was re-directed to this app
- // params will be empty if no data found
- // ... insert custom logic here ...
- Log.i("BRANCH SDK", referringParams.toString());
- } else {
- Log.i("BRANCH SDK", error.getMessage());
- }
- }
- }, this.getIntent().getData(), this);
- }
- @Override
- public void onNewIntent(Intent intent) {
- this.setIntent(intent);
- }
- Enable Auto Session Management
- Add this to your custom Application class file:
- public final class CustomApplicationClass extends Application {
- @Override
- public void onCreate() {
- super.onCreate();
- // Initialize the Branch object
- Branch.getAutoInstance(this);
- content_copy
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement