Screen API in Mobile SDKs

Learn about the screen API call in the Android (Kotlin) and iOS (Swift) SDKs.

This guide explains how to use the screen API in the RudderStack Android (Kotlin) and iOS (Swift) SDKs.

Overview

The RudderStack Android (Kotlin) and iOS (Swift) SDKs provide a screen API that lets you record whenever your user views their mobile screen, along with any additional relevant information about the screen.

Android (Kotlin)

The screen method definition in the Android (Kotlin) SDK is as follows:

Method signature

The below table describes the screen method signature in detail:

FieldData typeDescription
screenNameStringName of the screen viewed by the user.
categoryStringScreen category.
propertiesPropertiesAdditional properties describing the screen to be sent along with the event.

Note: The properties type in Java is Map<String, Object>.
optionsRudderOptionAdditional event options.

Example

A sample screen event sent from the Android (Kotlin) SDK is shown below:

iOS (Swift)

The screen method definition in the iOS (Swift) SDK is as follows:

Method signature

The below table describes the screen method signature in detail:

FieldData typeDescription
screenNameStringName of the screen viewed by the user.
categoryStringScreen category.
propertiesPropertiesAdditional properties describing the screen to be sent along with the event.
optionsRudderOptionAdditional event options.

Example

A sample screen event sent from the iOS (Swift) SDK is shown below:


Questions? Contact us by Email or on Slack