title: Firebase Deep Link Opens the Play Store instead of App
body: <p>Hello there I am new to Firebase Dynamic Links and learning it to my own, I have been following <a href="https://firebase.google.com/docs/dynamic-links/use-cases/rewarded-referral" rel="noreferrer">this</a> tutorial to get through it.</p>
  
  <p>My Code Creation method is:</p>
  
  <pre><code>private void createLink() {
          String link = "https://play.google.com/store/apps/details?id=com.test.app&amp;referrer="+"test1234" ;
          FirebaseDynamicLinks.getInstance().createDynamicLink()
                  .setLink(Uri.parse(link))
                  .setDynamicLinkDomain("testxyz.page.link")
                  .setAndroidParameters(
                          new DynamicLink.AndroidParameters.Builder("com.test.app")
                                  .setMinimumVersion(125)
                                  .build())
                  .buildShortDynamicLink().addOnFailureListener(new OnFailureListener() {
              @Override
              public void onFailure(@NonNull Exception e) {
                  Log.e("xyz", "error:::" + e.toString());
              }
          })
                  .addOnSuccessListener(new OnSuccessListener&lt;ShortDynamicLink&gt;() {
                      @Override
                      public void onSuccess(ShortDynamicLink shortDynamicLink) {
                          Log.e("xyz", "link:::" + shortDynamicLink.getShortLink());
                      }
                  });
      }
  </code></pre>
  
  <p>It gives me the url like: <strong><a href="https://testxyz.page.link/RhSKMYMnE2YHLbZk6" rel="noreferrer">https://testxyz.page.link/RhSKMYMnE2YHLbZk6</a></strong>
  I copied and pasted it to my browser and it works fine, took me to the play store and showed my required app that I want to open with this link with app id: <strong>com.test.app</strong></p>
  
  <p>What I done for testing is to click on this url from my Android Phone that has the app installed with app id: <strong>com.test.app</strong> that it should be opened with the URL I clicked!</p>
  
  <p>I am receiving the Link in my app with id: <strong>com.test.app</strong> with method:</p>
  
  <pre><code>private void check(){
          FirebaseDynamicLinks.getInstance()
                  .getDynamicLink(getIntent())
                  .addOnSuccessListener(this, new OnSuccessListener&lt;PendingDynamicLinkData&gt;() {
                      @Override
                      public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) {
                          // Get deep link from result (may be null if no link is found)
                          Uri deepLink = null;
                          if (pendingDynamicLinkData != null) {
                              deepLink = pendingDynamicLinkData.getLink();
                              Log.e("deeplink","link:::"+deepLink);
                              Toast.makeText(IndexActivity.this, "link:::"+deepLink, Toast.LENGTH_SHORT).show();
                          }else{
                              Log.e("deeplink","link is null:::");
                              Toast.makeText(IndexActivity.this, "link is null:::", Toast.LENGTH_SHORT).show();
                          }
                          //
                          // If the user isn't signed in and the pending Dynamic Link is
                          // an invitation, sign in the user anonymously, and record the
                          // referrer's UID.
                          //
  
                      }
                  });
      }
  </code></pre>
  
  <p>This method is being placed inside my main activity that comes after my Splash activity!</p>
  
  <p>So the manifest has:</p>
  
  <pre><code>&lt;activity
              android:name=".MainActivity"
              android:screenOrientation="portrait"&gt;
              &lt;intent-filter android:autoVerify="true"&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="https://testxyz.page.link"
                      android:scheme="http"/&gt;
                  &lt;data
                      android:host="https://testxyz.page.link"
                      android:scheme="https"/&gt;
              &lt;/intent-filter&gt;
  
          &lt;/activity&gt;
  </code></pre>
  
  <hr>
  
  <p>The Problem:
  When i clicked my Firebase generated Dynamic Link it works and takes me to the browser and opened the Google Play Store with my required app.</p>
  
  <p>What I want is to open the app and get the dynamic link info for the <strong>referrer</strong>!</p>
  
  <p>What I am doing wrong is that I have no idea because I am totaly new to Firebase Deep Linking.</p>
  
  <p>Actually I want to create a link that I can send to the other user with my username and if the user clicks that link will open up the app if installed and if not installed take the user to the app store installs the app and get the deep link info for <strong>referrer</strong></p>
  
  <p>Any help or tutorial is heighly appreciated, thanks in advance!</p>