iOS SDK FAQ

Use the following method with the desired size:

(void)setDefaultImageSize:(nonnull NSString *)size;

I need to play Audio Ads along with Dialogue Ads. What I need to do?

Just use

[_adman prepareWithType:AdmanTypeAny];

instead of

[_adman prepareWithType:AdmanTypeVoice];

How to handle AdmanStateError state?

In case of an error, you will receive AdmanStateError state. Please find the ways to handle it below:

general SDK errors handler
- (void)admanStateDidChange:(Adman *)sender {
switch (sender.state) {
case AdmanStateError:
do_something();
break;
default:
break;
}
}
// to get detailed error info (if needed)
- (void)errorReceived:(nullable NSError *) error {
do_something();
}

How to handle ad preloading?

When using the ad preloading, it is necessary to call the method [adman reportAdEvent:@"can_show"]; at the time of possible launch of advertising, even in cases, when advertising wasn't actually loaded or played.

This method provides the measurement of advertising capacity.

How to create two instances of Adman with different regions?

Please find the example below:

(void)init {
self.admanEU = [[Adman alloc] initWithSiteId:777 testMode:NO withZoneId:0 region:AdmanRegionEU playerId:0];
self.admanEU.delegate = self;
self.admanUS = [[Adman alloc] initWithSiteId:778 testMode:NO withZoneId:0 region:AdmanRegionGlobal playerId:0];
self.admanUS.delegate = self;
}
-(void)admanStateDidChange:(Adman *)sender {
switch (sender.state) {
case AdmanStateAdNone:
if ([sender currentRegion] == AdmanRegionEU)
[_admanUS prepare];
default:
break;
}
}

How to call an ad with specific slot?

In order to specify the slot for an ad, the below method should be called before calling prepare

[setAdSlot:SlotName]

Possible values for SlotName:

Value Name

Description

AdmanPreroll

Will play only ads that should be played before the content or ads without specific slot.

AdmanMidroll

Will play only ads that should be played in the middle of the content or ads without specific slot.

AdmanPostroll

ill play only ads that should be played after the content or ads without specific slot.

How to change the look of the DefaultView?

Background color can be changed using the following method:

- (void)setBackgroundColor:(nonnull UIColor *)backgroundColor;

Font color can be changed using the following method:

- (void)setTextColor:(nonnull UIColor *)textColor;

Buttons color can be changed using the following method:

- (void)setBackgroundColor:(nonnull UIColor *)backgroundColor forButton:(AdmanUIButton)button;

Buttons text color can be changed using the following method:

- (void)setTitleColor:(nonnull UIColor *)color forButton:(AdmanUIButton)button;

For custom button the following method can be used:

- (void)setCustomControlIcon:(nullable AdmanUICustomIcon *)icon forButton:(AdmanUIButton)button;

How to set the size of Ad View?

You can use the following method in order to change the size and position of the Ad View:

setViewMaxBounds(x, y, width, height)

In the parameters you need to set the position and size of the desired Ad View.

Please find the usage example HERE