Install Userpilot on Android Application
kotlin-android
plugin in your app module’s build.gradle
or ensure your Android Gradle Plugin is on 8.4.0 or higher.kotlin-android
plugin in app’s build.gradle file.Related Google issue regarding usage of the Jetpack Compose dependency versions 1.6+.Android Gradle Plugin:
<latest_version>
with the latest release version).
<APP_TOKEN>
with your Application Token, which can be fetched from your Environments Page.
androidx.startup.InitializationProvider
, you should not set tools:node="ignore"
on this provider to disable it. Doing so will prevent Userpilot SDK from being initialized correctly.
Instead, make sure to merge the provider declarations using:tools:node="merge"
This ensures that your custom initializers and the Userpilot initializer both get registered properly.
identify
when a user signs in to establish their identity for all future events.identify
at app launch.id
is required in company properties, to identify a unique company.locale_code
with a value that adheres to ISO 639-1 format.email
to pass the user’s email.name
to pass the user’s or company’s name.created_at
to pass the user’s or company’s signed up date.screen
is crucial for unlocking Userpilot’s core engagement and analytics capabilities. When a user navigates to a particular screen, invoking screen
records that view and triggers any eligible in-app experiences. Subsequent events are also attributed to the most recently tracked screen, providing context for richer analytical insights. For these reasons, we strongly recommend tracking all of your app’s screen views.
logout()
to clear the current user context. This ensures subsequent events are no longer associated with the previous user.
anonymous()
to track events without a user ID. This is useful for pre-signup flows or guest user sessions.
UserPilotNavigationHandler
. When a deep link with a defined schema and host is present in the manifest file, the SDK will open the corresponding activity. If the link is external, the SDK will handle it appropriately. For complete control over link handling, you can override the UserPilotNavigationHandler
interface. This allows you to customize the behavior for all types of links as per your requirements.
The useInAppBrowser
flag which work when you didn’t implement UserpilotNavigationHandler
determines whether to open URLs using an in-app browser (e.g., Chrome Custom Tabs) or fall back to the system browser or a different method.
useInAppBrowser
**is ** true
:useInAppBrowser
**is ** false
or not set :POST_NOTIFICATIONS
permission in order to display push notifications.
<service>
. Go to your Manifest file and add:
UserpilotFirebaseMessagingService
to your service class.
intent-filter
in your app’s **entry **Activity
in Manifest.xml
.
This configuration enables deep linking based on a custom scheme defined in your app.
Define the Deep Link Scheme In your userpilot.xml
configuration file, you should have defined a value for userpilot_push_notification
, check Step 5.
Update Manifest file to include the intent-filter as below. Make sure to set host="sdk"
.
activity
, pass intent to userpilot SDK to handle it.
<resources>
properties. In order change those properties create a file under res/values
and set it to desired values.