AdColonyZone Class Reference

Inherits from NSObject
Declared in AdColonyZone.h

Overview

AdColonyZone objects aggregate informative data about an AdColony zone such as its unique identifier, its ADCOLONY_ZONE_TYPE, etc. AdColonyZones also provide a block-based handler for zone-level reward events. Note that you should never instantiate one of these objects directly. You only need to use them when they are passed to you.

Zone

  identifier

Represents the given zone’s unique string identifier.

@property (nonatomic, readonly) NSString *identifier

Discussion

AdColony zone IDs can be created at the Control Panel.

Declared In

AdColonyZone.h

  type

Represents the zone type - interstitial, banner, or native.

@property (nonatomic, readonly) AdColonyZoneType type

Discussion

You can set the type for your zones at the Control Panel.

See Also

Declared In

AdColonyZone.h

  enabled

Indicates whether or not the zone is enabled.

@property (nonatomic, readonly) BOOL enabled

Discussion

Sending invalid zone id strings to configureWithAppID:zoneIDs:options:completion: will cause this value to be NO.

Declared In

AdColonyZone.h

Rewards

  rewarded

Indicates whether or not the zone is configured for rewards.

@property (nonatomic, readonly) BOOL rewarded

Discussion

You can configure rewards in your zones at the Control Panel. Sending invalid zone id strings to configureWithAppID:zoneIDs:options:completion: will cause this value to be NO.

Declared In

AdColonyZone.h

  viewsPerReward

Represents the number of completed ad views required to receive a reward for the given zone.

@property (nonatomic, readonly) NSUInteger viewsPerReward

Discussion

This value will be 0 if the given zone is not configured for rewards.

Declared In

AdColonyZone.h

  viewsUntilReward

Represents the number of ads that must be watched before a reward is given.

@property (nonatomic, readonly) NSUInteger viewsUntilReward

Discussion

This value will be 0 if the given zone is not configured for rewards.

Declared In

AdColonyZone.h

  rewardAmount

Represents the reward amount for each completed rewarded ad view.

@property (nonatomic, readonly) NSUInteger rewardAmount

Discussion

This value will be 0 if the given zone is not configured for rewards.

Declared In

AdColonyZone.h

  rewardName

Represents the singular form of the reward name based on the reward amount.

@property (nonatomic, readonly) NSString *rewardName

Discussion

This value will be an empty string if the given zone is not configured for rewards.

Declared In

AdColonyZone.h

Handling Rewards

– setReward:

Sets a block-based reward handler for your zone.

- (void)setReward:(nullable void ( ^ ) ( BOOL success , NSString *name , int amount ))reward

Discussion

Based on the success parameter, client-side reward implementations should consider incrementing the user’s currency balance in this method. Server-side reward implementations, however, should consider the success parameter and then contact the game server to determine the current total balance for the virtual currency. Note that the associated block of code will be dispatched on the main thread.

Declared In

AdColonyZone.h