rememberConsent

Composable function to remember and manage user consent for ads.

This function creates and remembers a Consent object, which handles interactions with the Google User Messaging Platform (UMP) SDK to obtain and manage user consent for personalized advertising.

It initializes the consent state and checks if privacy options are required and if ads can be requested.

Return

A MutableState holding the Consent object. This allows observing and reacting to changes in the consent status within your Composable UI.

Parameters

activity

The current Activity context. This is crucial for the UMP SDK to function correctly. It's recommended to pass the result of LocalContext.current as? Activity.

See also