Preinstalled apps
You can use the Adjust SDK to check if your app came pre-installed on a user's device. There are four methods you can use to perform this check.
To enable the Adjust SDK to recognize preinstalled apps, you need to set this in your config object. Call setPreinstallTrackingEnabled
function and set its value to true
in your config object to do this.
setPreinstallTrackingEnabled
function is required.Find out more about the SDK requirements and additional steps for each method below.
System Properties method
SDK requirement
- Adjust SDK v4.23.0 and later
The OEM writes engagement data to a file, and specifies the file path in the device system properties. The Adjust SDK reads the file on initialization.
Content provider method
SDK requirement
- Adjust SDK v4.23.0 and later
The preloaded app creates a read-only content provider, and the Adjust SDK uses a content resolver to query the device app’s request.
To set the permissions, add the following to your AndroidManifest.xml
file.
<uses-permission android:name="com.adjust.preinstall.READ_PERMISSION"/>
To access a list of preinstalled apps on the device, add the following to your AndroidManifest.xml
file.
<queries>
<intent>
<action android:name="com.attribution.REFERRAL_PROVIDER"/>
</intent>
</queries>
System Installer Receiver method
SDK requirement
- Adjust SDK v4.27.0 and later
The system installer broadcasts the attribution information for a pre-installed app, while the Adjust SDK receives it using the receiver.
To declare the receiver, add the following to your AndroidManifest.xml
file.
<receiver android:name="com.adjust.sdk.AdjustPreinstallReferrerReceiver">
<intent-filter>
<action android:name="com.attribution.SYSTEM_INSTALLER_REFERRER" />
</intent-filter>
</receiver>
World-Readable Directory method
SDK requirement
- Adjust SDK v4.23.0 and later
Save preloaded app attribution information in a world-readable directory, for example, /sdcard
. It allows all apps to read from that directory while the encryption protocol protects the app data.