Skip to content

Instantly share code, notes, and snippets.

@yishai-glide
Created July 8, 2015 13:03
Show Gist options
  • Save yishai-glide/450b5e2c12de1044f487 to your computer and use it in GitHub Desktop.
Save yishai-glide/450b5e2c12de1044f487 to your computer and use it in GitHub Desktop.
<receiver
android:name="com.thepoosh.pooshmeister.InstallReferrerReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
@Override
public void onReceive(Context context, Intent intent) {
String referrer = "";
if (intent != null && intent.hasExtra("referrer")) {
referrer = intent.getStringExtra("referrer");
SharedPrefsManager.getInstance().setInstallReferrer(referrer);
new AsyncTask<String, Void, Void>() {
@Override
protected Void doInBackground(String... params) {
String referrer = params[0];
if(TextUtils.isEmpty(referrer) == false){
VolleyServer.getInstance().smsReportInstall(referrer, REPORT_INSTALL_LISTENER, REPORT_INSTALL_ERROR_LISTENER);
}
return null;
}
}.executeOnExecutor(GlideAsyncTask.THREAD_POOL_EXECUTOR, referrer);
Utils.logIntent(TAG, "onReceive()", intent, true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment