简体   繁体   中英

INSTALL_REFERRER not sending on production

I have code that works when testing with ADB but does nothing when installed from the play store. Please help.

public class RefReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
    String referrer = intent.getStringExtra("referrer");
    android.util.Log.d("[REFERRER]",referrer);

    String[] myTaskParams = { referrer, "test" };
    new NetworkAccess().execute(myTaskParams);
}
}

 class NetworkAccess extends AsyncTask<String, Void, Boolean> {


@Override
protected void onPreExecute() {
    super.onPreExecute();

}

@Override
protected Boolean doInBackground(String... urls) {
    HttpResponse response = null;
    try {
        HttpClient client = new DefaultHttpClient();
        String takeOne = urls[0];
        String take2 = takeOne.replace("custom_key=","");
        String fin = take2.replace("&utm_source=re","");
        String URL = "https://mysite.asia/custom_conversions/complete/fVZYNOW?user_key="+fin;
        android.util.Log.d("[REFERRER]",URL);
        HttpGet httpget= new HttpGet();
        httpget.setURI(new URI(URL));
        response = client.execute(httpget);
    } catch (URISyntaxException e) {
        e.printStackTrace();
    }
    catch (ClientProtocolException e) {
        // TODO Auto-generated catch block
    } catch (IOException e) {
        // TODO Auto-generated catch block
    }
    return false;
}

protected void onPostExecute(Boolean result) {

}
}

I have the manifest setup up like this.

 <!-- Used for install referrer tracking-->
        <receiver
            android:name="asia.rewardeagle.rewardeagle.web.RefReceiver"
            android:exported="true" >
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER" >
                </action>
            </intent-filter>
        </receiver>

I have already searched the web for an answer and have found nothing promising. Please help.

This is an issue where google play does not send the referral until a few moments after the app is installed.

https://help.tune.com/marketing-console/android-problem-collecting-install-referrer-on-download/ uhgggg....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM