developer developer - 5 months ago 42
iOS Question

iOS FBAudienceNetwork Error codes consts

In android when I get error I get an com.facebook.ads.AdError class.
For that i can check which kind of error as occurred (like NETWORK_ERROR_CODE,NO_FILL_ERROR_CODE,...)

In iOS i am getting a general NSError object in case of error, for example:

- (void)adView:(FBAdView *)adView didFailWithError:(NSError *)error;


how can I check which kind of error occurred in iOS?

Answer

There are no error domains or constants in FBAudienceNetwork iOS SDK.

com.facebook.ads.AdError.NO_FILL_ERROR_CODE is a local error code for FB SDK (android). It is not necessary that you can find those codes in iOS.

To see detail of error just log your error like so:

NSLog(@"Error %@",[error localizedDescription]);

Error Codes available in Facebook SDK can be found here and here (Facebook Ads).

I'll suggest you to find error domain first. iOS usage Domains and Codes for error identification. Reference

NSURLErrorDomain codes are here.