Mobile/Distribution Files: Difference between revisions

Add Android mechanism
(Correct am syntax)
(Add Android mechanism)
Line 236: Line 236:
<pre>
<pre>
am broadcast -a com.android.vending.INSTALL_REFERRER \
am broadcast -a com.android.vending.INSTALL_REFERRER \
             -n org.mozilla.fennec/org.mozilla.gecko.distribution.ReferrerReceiver \
             -n org.mozilla.firefox/org.mozilla.gecko.distribution.ReferrerReceiver \
             -f 32 \
             -f 32 \
             --es "referrer" "utm_source=mozilla\&utm_content=testsigned\&utm_campaign=distribution"
             --es "referrer" "utm_source=mozilla\&utm_content=testsigned\&utm_campaign=distribution"
Line 244: Line 244:


(The -f 32 flag makes sure this intent is sent to stopped packages.)
(The -f 32 flag makes sure this intent is sent to stopped packages.)
You can also do this from another Android application:
<pre>
        Intent i = new Intent("com.android.vending.INSTALL_REFERRER");
        i.setPackage("org.mozilla.firefox");
        i.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
        i.putExtra("referrer", "utm_source=mozilla&utm_content=testsigned&utm_campaign=distribution");
        getContext().sendBroadcast(i);
</pre>


Telemetry will be recorded for the download: <code>FENNEC_DISTRIBUTION_DOWNLOAD_TIME_MS</code> records the download time in milliseconds, and <code>FENNEC_DISTRIBUTION_CODE_CATEGORY</code> records the result. The value will be one of these:
Telemetry will be recorded for the download: <code>FENNEC_DISTRIBUTION_DOWNLOAD_TIME_MS</code> records the download time in milliseconds, and <code>FENNEC_DISTRIBUTION_CODE_CATEGORY</code> records the result. The value will be one of these:
219

edits