public class

ReferrerReceiver

extends BroadcastReceiver
java.lang.Object
   ↳ android.content.BroadcastReceiver
     ↳ com.appbrain.ReferrerReceiver

Class Overview

This class receives the install string from the Android market. It should be included in the AndroidManifest (within the application tag) like this:

 <receiver android:name="com.appbrain.ReferrerReceiver" android:exported="true">
   <intent-filter> 
     <action android:name="com.android.vending.INSTALL_REFERRER"/> 
   </intent-filter> 
 </receiver>
 
 
If you have custom receivers that you also want to have notified, you can specify them using meta-data parameters, like for instance in the following snippet, where both the analytics and AdMob install receivers are notified of a referrer as well (android.name can be any value as long as it starts with "forward."):
 <receiver android:name="com.appbrain.ReferrerReceiver" android:exported="true">
   <intent-filter> 
     <action android:name="com.android.vending.INSTALL_REFERRER"/> 
   </intent-filter>
   <meta-data android:name="forward.GoogleAnalytics" android:value="com.google.android.apps.analytics.AnalyticsReceiver" />
   <meta-data android:name="forward.Admob" android:value="com.google.ads.InstallReceiver" />
   <meta-data android:name="forward.AnotherOne" android:value="com.myapp.CustomReceiver" />
 </receiver>
 
 

Summary

Public Constructors
ReferrerReceiver()
Public Methods
void onReceive(Context arg0, Intent arg1)
Receive the referrer String from the Android market.
static String retrieve(Context context)
Retrieve the saved referrer String from the Android market.
[Expand]
Inherited Methods
From class android.content.BroadcastReceiver
From class java.lang.Object

Public Constructors

public ReferrerReceiver ()

Public Methods

public void onReceive (Context arg0, Intent arg1)

Receive the referrer String from the Android market.

public static String retrieve (Context context)

Retrieve the saved referrer String from the Android market.

Parameters
context The current Android context
Returns
  • The referrer String, or null of there was none.