Configuration & Customizations for iOS

The SDK allows you to modify the ad targeting and to control playback behavior. You can also customize the UI appearance.

Ad Targeting Options

You can specify additional information about the current user. The data is sent along with ad requests to achieve better ad targeting.
It can also be used to link Custom Events to a specific user.

Integration

Using Objective-C:

// Set up config with client token
FAConfig *config = [FAConfig new];
config.clientToken = @"your-client-token";

// Add data about your user
config.userAge = 42;
config.userGender = FAUserGenderFemale;
config.userId = @"your-user-id";

// Reconfigure FAManager
[[FAManager sharedManager] configure:config];

Using Swift:

// Set up config with client token
FAConfig *config = [FAConfig new];
config.clientToken = @"your-client-token";

// Add data about your user
config.userAge = 42;
config.userGender = FAUserGenderFemale;
config.userId = @"your-user-id";

// Reconfigure FAManager
[[FAManager sharedManager] configure:config];

You can reconfigure the SDK at any time. This allows you to react to logins, logouts or any other events that offer insight into your user's behavior.

Targeting Parameters

Name Type Description
FAConfig.userAge NSInteger The age of the current user in years
FAConfig.userGender FAGender The gender of the current user (FAGenderFemale or FAGenderMale)
FAConfig.userId NSString * The ID of the current user

Playback Behavior

It may be necessary to cancel all instances of FAFeedAd currently active in your app. For example, if a user tries to share video content from your app with an AirPlay device, iOS may confuse the content that should be shared with the videos running inside FAFeedAd.

Using Objective-C:

[[FAManager sharedManager] cancelAllFeedAds]

Using Swift:

FAManager.shared().cancelAllFeedAds()

UI Customizations

Ad Backgrounds

To improve the user experience while the SDK is loading, you may wish to customize the backgrounds for your ad placements.

The ad types Feed Ad and Standalone Ad support this natively by having a transparent background. This means you can simply put any view, image, etc. into the background of your ad container to have it appear while the FeedAd SDK is loading. Once a creative is shown / playing, it will cover your background.

For the ad type Interstitial Ad, you may implement the following delegate method of FAInterstitialAdDelegate:

- (UIView *)backgroundViewForInterstitialAd:(FAInterstitialAd *)interstitialAd;

It allows you to pass any UIView to the interstitial ad for display in its background. The view you pass will be resized to match the expected size of the ad.

Loading Indicators

Besides customizing your ad backgrounds, you may also wish to disable the loading indicator that is displayed while an ad is loading. You can implement the following delegate methods and have them return NO to achieve this:

- (BOOL)feedAdShouldDisplayLoadingIndicator:(FAFeedAd *)feedAd;
- (BOOL)interstitialAdShouldDisplayLoadingIndicator:(FAInterstitalAd *)interstitialAd;
- (BOOL)standaloneAdShouldDisplayLoadingIndicator:(FAStandaloneAd *)standaloneAd;

Mute / Unmute Button

You can change the appearance of the following FeedAd UI elements by including the respective image files in the main bundle of your app:

Recommended size:

24x24 px

Filenames:

  • fa_audio_muted
  • fa_audio_muted@2x
  • fa_audio_muted@3x
  • fa_audio_unmuted
  • fa_audio_unmuted@2x
  • fa_audio_unmuted@3x