title: How to read query parameters from Firebase dynamic links (FDL) in an android APP
body: <p>I'm developing an Android app where I have used Firebase Password Authentication to sign in users. </p>
  
  <p>After users provide their email and password, <strong>I'm sending a verification e-mail using FirebaseAuth SDK.</strong> </p>
  
  <pre><code>/**  SEND A VERIFICATION MAIL TO THE USER **/
  ActionCodeSettings.Builder settingBuilder  =  ActionCodeSettings.newBuilder();
  String url = getString(R.string.link_mail_verification);
  
  settingBuilder.setUrl(url).setHandleCodeInApp(true);
  
  ActionCodeSettings settings = settingBuilder.build();
  
  user.sendEmailVerification(settings).addOnCompleteListener(new OnCompleteListener&lt;Void&gt;() {
  @Override
  public void onComplete(@NonNull Task&lt;Void&gt; task) {
  
  if(task.isSuccessful()){
  
     Log.e("MAIL_VERIFICATION", "onComplete: mail verification sent" );
  
  }else{
      // not sent
  
    }
   }
  });
  </code></pre>
  
  <p>While verifying their email, I want users to be redirected in the app directly if it is installed, that's where I used <strong>Dynamic link</strong> </p>
  
  <p>First, I started by creating a Dynamic Link in the firebase console 
  <a href="https://i.stack.imgur.com/17Ek4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/17Ek4.png" alt="enter image description here"></a></p>
  
  <p>Secondly I modified the firebase e-mail template to use my dynamic link as the action url. 
  <a href="https://i.stack.imgur.com/ImgFo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ImgFo.png" alt="enter image description here"></a></p>
  
  <p>and in the e-mail sent to the user , some query parameters (e.g: oobCode, apiKey) are appended to the dynamic link. 
  <a href="https://i.stack.imgur.com/kGwuX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kGwuX.png" alt="enter image description here"></a></p>
  
  <p>When the user clicks the above link, it correctly redirects to the app and open the activity that is registered to receive dynamic links. </p>
  
  <p>My real problem is , how can I, from an Android application get all the query parameters present in the link sent to the user. </p>
  
  <p>The methods that I tried so far, and didn't work : 
  <strong>Method 1 : trying to get the query from Intent</strong></p>
  
  <pre><code>FirebaseDynamicLinks.getInstance().getDynamicLink(getIntent()).addOnSuccessListener(new OnSuccessListener&lt;PendingDynamicLinkData&gt;() {
          @Override
          public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) {
  
              Uri deepLink = null;
              if(pendingDynamicLinkData != null){
                  deepLink = pendingDynamicLinkData.getLink();
              }
  
              // trying to get from the intent
              if(deepLink != null){
  
                   Uri intentData = getIntent().getData();
                   if(intentData != null){
  
                       String code =  getIntent().getStringExtra("oobCode"); // always returns null
  
                   }
              }
          }
      });
  </code></pre>
  
  <p><strong>Method 2: trying to get the query parameter from PendingDynamicLinkData</strong></p>
  
  <pre><code> FirebaseDynamicLinks.getInstance().getDynamicLink(getIntent()).addOnSuccessListener(new OnSuccessListener&lt;PendingDynamicLinkData&gt;() {
          @Override
          public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) {
  
              Uri deepLink = null;
              if(pendingDynamicLinkData != null){
                  deepLink = pendingDynamicLinkData.getLink();
              }
  
              // trying to get from the deep link URI
              if(deepLink != null){
  
                  String code = deepLink.getQueryParameter("oobCode"); // returns null too
              }
          }
      });
  </code></pre>
  
  <p>And the following is my manifest.xml</p>
  
  <pre><code>&lt;activity
          android:name=".activities.MainActivity"
          android:label="@string/app_name"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;action android:name="android.intent.action.VIEW"/&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
  
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.VIEW"/&gt;
              &lt;category android:name="android.intent.category.DEFAULT"/&gt;
              &lt;category android:name="android.intent.category.BROWSABLE"/&gt;
              &lt;data
                  android:host="@string/app_link_domain"
                  android:scheme="https"
                /&gt;
          &lt;/intent-filter&gt;
  
      &lt;/activity&gt;
  </code></pre>