title: Branch error Warning. Session initialization already happened. (-118)
body: <p>I have a launcher Activity, which is set to receive deep Branch intents.</p>
  <p>When there arent any Activities in the back stack, <code>onInitFinished(JSONObject, BranchError)</code> gives this BranchError, and jSONProject is null:</p>
  <blockquote>
  <p>Warning. Session initialization already happened. To force a new session, set intent extra, &quot;branch_force_new_session&quot;, to true.</p>
  </blockquote>
  <p>AndroidManifest.xml:</p>
  <pre><code>    &lt;activity
          android:name=&quot;LauncherActivity&quot;
          android:launchMode=&quot;singleTask&quot;&gt;
  
          &lt;intent-filter&gt;
              &lt;action android:name=&quot;android.intent.action.VIEW&quot; /&gt;
  
              &lt;category android:name=&quot;android.intent.category.BROWSABLE&quot; /&gt;
              &lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;
  
              &lt;data android:scheme=&quot;myscheme&quot; /&gt;
          &lt;/intent-filter&gt;
  
          &lt;intent-filter android:autoVerify=&quot;true&quot;&gt;
              &lt;action android:name=&quot;android.intent.action.VIEW&quot; /&gt;
  
              &lt;category android:name=&quot;android.intent.category.BROWSABLE&quot; /&gt;
              &lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;
  
              &lt;data
                  android:host=&quot;my.domain.com&quot;
                  android:scheme=&quot;https&quot; /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  </code></pre>
  <p>Activity:</p>
  <pre><code>class LauncherActivity : Branch.BranchReferralInitListener {
  
      override fun onStart() {
          super.onStart()
  
          Branch.sessionBuilder(this).withCallback(this).withData(parseIntent().data).init()
  
          if (BuildConfig.DEBUG) {
              IntegrationValidator.validate(this)
          }
      }
  
      private fun parseIntent(): Intent {
          var newIntent = Intent()
          newIntent = newIntent.putExtra(&quot;branch_force_new_session&quot;, true)
          newIntent = newIntent.putExtra(&quot;branch&quot;, intent.dataString)
          return newIntent
      }
  
      override fun onNewIntent(intent: Intent) {
          super.onNewIntent(intent)
  
          this.intent = intent
  
          Branch.sessionBuilder(this).withCallback(this).withData(parseIntent().data).reInit()
      }
  
      override fun onInitFinished(referringParams: JSONObject?, error: BranchError?) {
          if (error != null) {
              // Getting error only when app is not backgrounded
          } else if (referringParams != null) {
              // When app is backgrounded, it works
          }
      }
  }
  </code></pre>
  <p>When an intent is received and the app is backgrounded, everything works.  When the app is launched due to a branch intent, I'm getting an error and the referringParams are null.  I've tried delaying the initialization as well.</p>
  <p>Any ideas?</p>