Enhance AdRequestOptions Extension Functions #161
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces enhancements to the extension functions for configuring
AdRequestOptions
related to ad content ratings and compliance with various app categories.Changes Made
Refinement of Existing Extension Functions
The existing extension functions for configuring
AdRequestOptions
have been refined and extended to include additional scenarios. The following extension functions are now available:setForChildrenApp()
: Configures options for apps designed specifically for children.setForFamilies()
: Configures options for apps targeting families, with support for primarily child-directed and mixed-audience apps.setForEveryoneApp()
: Configures options for apps targeting everyone, including children and families.setForTeens()
: Configures options for apps targeting teens.setForAdults()
: Configures options for apps targeting adults.These extension functions provide a streamlined way to set the appropriate content rating and treatment options for ads, ensuring compliance with policies and regulations across different app categories.
How to Use
You can utilize the extension functions to configure
AdRequestOptions
for various app categories as needed. The method for configuringAdRequestOptions
depends on your context:If you are within a Composable context, you can access the
AdRequestOptions
viaLocalAdsControl.current
:If you are outside of a Composable context, you can use
AdMob.configureAdRequest
:Choose the appropriate method based on your context to configure
AdRequestOptions
for your application's specific requirements.This allows you to easily set the appropriate ad content rating and treatment options for ads within your application.