0

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!

4

1 回答 1

1

您需要将接收器添加到您的清单中,以便您的应用知道您有一些东西正在监听广播。像这样的东西:

<receiver android:name="com.company.cool.SDK_Referrer" android:exported="true">
    <intent-filter>
      <action android:name="com.android.vending.INSTALL_REFERRER" />
    </intent-filter>
  </receiver>
于 2012-07-05T22:49:55.810 回答