Our SDKs return errors as integer codes, but to make this more manageable, we've provided a set of named constants that correspond to these codes. (ex. #define kALErrorCodeNoFill 204) This gives you the flexibility to check for errors using the named constants. Here is an iOS example:
-(void)adService:(ALAdService *)adService didFailToLoadAdWithError:(int)code {
if(code == kALErrorCodeNoFill) {
[self foo];
}}
If you are checking for the specific error returned, we recommend using these named constants vs. the integers in your code. You can find out more about our error codes here and in ALErrorCodes.h
Loading & Displaying Ads:
#define kALErrorCodeNoFill 204
// Indicates that no ads are currently eligible for your device & location.
#define kALErrorCodeAdRequestNetworkTimeout -1001
// Indicates that a fetch ad request timed out (usually due to poor connectivity).
#define kALErrorCodeNotConnectedToInternet -1009
// Indicates that the device is not connected to internet (for instance if user is in Airplane mode). This returns the same code as NSURLErrorNotConnectedToInternet.
#define kALErrorCodeAdRequestUnspecifiedError -1
// Indicates that an unspecified network issue occured.
#define kALErrorCodeUnableToRenderAd -6
// Indicates that there has been a failure to render an ad on screen.
#define kALErrorCodeUnableToPrecacheResources -200
// Indicates that an attempt to cache a resource to the filesystem failed; the device may be out of space.
#define kALErrorCodeUnableToPrecacheImageResources -201
// Indicates that an attempt to cache an image resource to the filesystem failed; the device may be out of space.
#define kALErrorCodeUnableToPrecacheVideoResources -202
// Indicates that an attempt to cache a video resource to the filesystem failed; the device may be out of space.
#define kALErrorCodeUnableToRenderNativeAd -700
// Indicates that there was an error while attempting to render a native ad
#define kALErrorCodeUnableToPreloadNativeAd -701
// Indicates that an unspecified network issue occurred.
Rewarded Videos:
#define kALErrorCodeIncentiviziedAdNotPreloaded -300
// Indicates that the developer called for a rewarded video before one was available.
#define kALErrorCodeIncentivizedUnknownServerError -400
// Indicates that an unknown server-side error occurred.
#define kALErrorCodeIncentivizedValidationNetworkTimeout -500
// Indicates that a reward validation requested timed out (usually due to poor connectivity).
#define kALErrorCodeIncentivizedUserClosedVideo -600
// Indicates that the user exited out of the rewarded ad early. You may or may not wish to grant a reward depending on your preference.
#define kALErrorCodeInvalidURL -900
// Indicates that a postback URL you attempted to dispatch was empty or nil.