什么是';操作android:name=";com.android.vending.INSTALL“u referer”';?

什么是';操作android:name=";com.android.vending.INSTALL“u referer”';?,android,referrer,receiver,Android,Referrer,Receiver,我已经测试了Appbrain SDK和Inmobi SDK。 我找到了一个普通的接收器。我做了定制的接收器。 我认为当在谷歌市场下载应用程序时,谷歌市场会向我的应用程序发送“referer”值。但我没有收到任何东西。有什么问题吗 //This is Appbrain's receiver <receiver android:exported="true" android:name="com.appbrain.ReferrerReceiver" > <intent-fil

我已经测试了Appbrain SDK和Inmobi SDK。 我找到了一个普通的接收器。我做了定制的接收器。 我认为当在谷歌市场下载应用程序时,谷歌市场会向我的应用程序发送“referer”值。但我没有收到任何东西。有什么问题吗

//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);
        }
    }
}
//这是Appbrain的接收器

很久以前,Android market会向您发送导致您安装的market页面的推荐字符串。谷歌在某个时候阻止了这一点。 你可以在这里看到一条线

现在,只有在打开市场应用程序时将is显式传递给市场应用程序,才能获得推荐人字符串。例如,如果应用程序A有一个安装应用程序B的按钮,您可以传递一个推荐人字符串
market://details?id=B&referrer=A. 它主要适用于想要衡量应用程序广告有效性的广告网络。需要注意的一点是,Android market/Google Play只会将安装推荐人发送到您在清单中定义的第一个接收者。因此,在这种情况下,只有AppLift接收器才能获得它

有一种方法可以从AppLift接收器“转发”事件,如JavaDoc中所述:

在您的情况下,您的清单应该如下所示:

//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>
    <meta-data android:name="forward.inmobi" android:value="com.inmobi.adtracker.androidsdk.IMAdTrackerInstallRefererReciever" /> 
    <meta-data android:name="forward.custom" android:value="com.xgame.adproject2.TestReceiver" />
</receiver>

// Keep the execution of InMobi on connectivity change
<receiver android:name="com.inmobi.adtracker.androidsdk.IMAdTrackerInstallRefererReciever" android:exported="true" >
   <intent-filter>
      <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
   </intent-filter>
</receiver>
//这是Appbrain的接收器

(这是关于从有机应用程序发现中恢复推荐人字符串,如果他们解决了这个问题,希望他们在Play网站安装时也会添加推荐人字符串)。

你能发布你的接收者代码吗。谢谢你的解释。我被请求使用这个uri。”market://details?id=com.xgame.adproject2&referrer=utm_source%3Dgoogle%26utm_medium%3Dgoogle%26utm_term%3Dbanner%26utm_campaign%3Dxgame”他成功了。