我測試過Appbrain SDK和Inmobi SDK。 我發現這個普通的接收器。我製作了定製的接收器。 我認爲,當在谷歌市場下載應用程序時,谷歌市場發送「引薦者」價值給我的應用程序。但我沒有收到任何東西。什麼問題?'action android:name =「com.android.vending.INSTALL_REFERRER」'是什麼?
//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 Web瀏覽器中輸入此URL。但下載應用程序後,我沒有收到referrer值。
您可以發佈您的接收器代碼。可能[重複](http://stackoverflow.com/q/4093150/1050058) –