2012-09-26 25 views

回答

5

根據平臺Localytics,the intent is fired once應用程序首次啓動時間前:

Android將觸發一個叫做意圖:在應用過程中 com.android.vending.INSTALL_REFERRER安裝 過程。這發生在應用程序啓動前的第一個 時間。

+0

只是一個除了@大衛的評論。在運行Android 3.2及更高版本的設備上首次啓動時會發送「com.android.vending.INSTALL_REFERRER」。 –

+1

這個意圖是否會在重新安裝時發送?那是。如果用戶卸載您的應用程序。然後,他們可能會點擊Google Play的推介鏈接(例如您運行的再次參與活動),然後重新安裝該應用。或者是僅在首次安裝時發送的意圖? –

+0

@BryantHarris它將在重新安裝時被解僱 – jimy

0

INSTALL_REFERRER意圖只是從App Store上的應用程序啓動第一次工作,你可以像使用波紋管樣品

public class ReferrerReceiver extends BroadcastReceiver { 
    String referrer; 
    public void onReceive(Context context, Intent intent) { 
     final String action = intent.getAction(); 

     if (action != null && TextUtils.equals(action, "com.android.vending.INSTALL_REFERRER")) { 
      try { 
       referrer = intent.getStringExtra("referrer"); 
       Log.d("REFERRER","ReferrerReceiver. "+referrer); 
       Toast.makeText(context, "ReferrerReceiver. "+referrer, Toast.LENGTH_LONG).show(); 
      } catch (Exception e) { 
       e.printStackTrace(); 
      } 
      } 
    } 
} 
相關問題