public static void Init(Application app, String branchKey, IBranchSessionInterface callback) { if (instance != null) { return; } if (!branchKey.StartsWith("key_", StringComparison.Ordinal)) { Console.WriteLine(branchKey + ": Usage of App Key is deprecated, please move toward using a Branch key"); } instance = new BranchAndroid(); Branch.branchInstance = instance; instance.appContext = app.ApplicationContext; instance.branchKey = branchKey; if (Debug) { instance.SetDebug(); } instance.lifeCycleHandler = new BranchAndroidLifeCycleHandler(callback); app.RegisterActivityLifecycleCallbacks(instance.lifeCycleHandler); // we call IniSession in BranchAndroidLifeCycleHandler.OnActivityStarted //getInstance().InitSession(callback); }
public static void Init(Application app, String branchKey, IBranchBUOSessionInterface callback) { if (instance != null) { instance.lifeCycleHandler.callbackBUO = callback; return; } if (!branchKey.StartsWith("key_")) { Console.WriteLine("Usage of App Key is deprecated, please move toward using a Branch key"); } instance = new BranchAndroid(); Branch.branchInstance = instance; instance.appContext = app.ApplicationContext; instance.branchKey = branchKey; if (Debug) { instance.SetDebug(); } instance.lifeCycleHandler = new BranchAndroidLifeCycleHandler(callback); app.RegisterActivityLifecycleCallbacks(instance.lifeCycleHandler); }