我已经测试了 Appbrain SDK 和 Inmobi SDK。我找到了这个普通的接收器。我制作了定制接收器。我认为在谷歌市场下载应用程序时,谷歌市场会向我的应用程序发送“推荐人”价值。但我什么都没收到。什么问题?
//This is Appbrain's receiver
<receiver android:exported="true" android:name="com.appbrain.ReferrerReceiver" >
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
//This is Inmobi's receiver
<receiver android:name="com.inmobi.adtracker.androidsdk.IMAdTrackerInstallRefererReciever" android:exported="true" >
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
</receiver>
//This is My Custom receiver
<receiver android:name="com.xgame.adproject2.TestReceiver" android:exported="true" >
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
// source
public class TestReceiver extends BroadcastReceiver{
public static final String TAG = "TEST";
String referrerString = "";
@Override
public final void onReceive(Context context, Intent intent) {
Log.e(TAG, "11111111");
if(intent.getAction().equals("com.android.vending.INSTALL_REFERRER")) {
Bundle extras = intent.getExtras();
referrerString = extras.getString("referrer");
Log.e(TAG, "REFERRER: " + referrerString);
}
}
}
关闭应用程序时,我在 android 网络浏览器中输入了这个 url。但下载应用程序后,我没有收到推荐人价值。