title: "com.android.vending.INSTALL_REFERRER" fetching referrer parameters on Broadcast has up to 15 seconds delays on some devices
body: <p>My server creates a link that redirects and passes parameters to google play store;</p>
  
  <p>The sms I receive by my Server;
  <a href="https://goo.gl/" rel="nofollow noreferrer">https://goo.gl/</a>{UNIQUE_ID}</p>
  
  <p>when I click, I actually click on this this url below;
  <a href="http://www.mycompany.com/env=dev&amp;token=123&amp;id=456" rel="nofollow noreferrer">http://www.mycompany.com/env=dev&amp;token=123&amp;id=456</a></p>
  
  <p>The link above directs me to google play store to my app included parameters;
  <a href="https://play.google.com/store/apps/details?id=com.mycompany.app&amp;referrer=123,456" rel="nofollow noreferrer">https://play.google.com/store/apps/details?id=com.mycompany.app&amp;referrer=123,456</a></p>
  
  <p>Here is the question;(First time installation)
  When I install the app opened with the link above, I want to pass those "token", "id" parameters to my app in first time then I will skip login. These parameters creating by server because they are also unique to user.</p>
  
  <p>I have setup the "com.android.vending.INSTALL_REFERRER" and I am able to receive parameters as expected but not consistent on every devices and could face with big delays.</p>
  
  <pre><code> &lt;receiver
          android:name=".GooglePlayReceiver"
          android:exported="true"
          android:permission="android.permission.INSTALL_PACKAGES"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.android.vending.INSTALL_REFERRER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  </code></pre>
  
  <p>My GooglePlayReceiver Broadcastreceiver is;</p>
  
  <pre><code>public class GooglePlayReceiver extends BroadcastReceiver {
  
  Context mContext;
  String purchaseId = null;
  
  public GooglePlayReceiver() {
  }
  
  @Override
  public void onReceive(Context context, Intent intent) {
      try {
          mContext = context;
          Bundle extras = intent.getExtras();
          String verificationCode = null;
          String phoneNumber = null;
          if (extras != null) {
              String code = extras.getString("referrer");
              String[] strArr = code != null ? code.split(",") : new String[0];
              token = strArr[0];
              id = strArr[1];
          }
      } catch (Exception ex) {
      }
  }}
  </code></pre>
  
  <p>This flow has big delays on some devices. For ex, Google Pixel 2 fetches the parameters immediately without delay, Samsung Galaxy S7 has 5-10 seconds delay.</p>
  
  <p>How to solve this?</p>