Reputation: 13747
i am trying to use install_referrer and have a question, my app only "catches" the referrer broadcast when its open or in the memory. but when you install an app from tha play store its not getting open nor on the memory, so how can i make my app catch the broadcast on installation if its not running on the backround? thats my code:
public class SDK_Referrer extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.d(TAG, "entered onRecive");
if (intent.getAction().equals("com.android.vending.INSTALL_REFERRER")) {
String referrer = intent.getStringExtra("referrer");
Thanks!
Upvotes: 0
Views: 457
Reputation: 270
You need to add the receiver to your manifest, so your app knows you have something listening for the broadcast. Something like this:
<receiver android:name="com.company.cool.SDK_Referrer" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
Upvotes: 1