[iOS] Facebook Ads are coming back with an error
See original GitHub issueTrying to get Facebook Ads to work and keep getting either “The SDK version in the ad request is no longer supported for new apps. Please upgrade to one of the latest versions of the SDK” or “Ad was re-loaded too frequently” error.
Tried both Interstitial and Banner ads, same result. First I see error 1012 - “The SDK version in the ad request is no longer supported…” then if I reload the app, I get the error code 1002 - “Ad was re-loaded too frequently”
This is happening on both simulator and Expo Client.
Relevant Code
FacebookAds.AdSettings.addTestDevice(FacebookAds.AdSettings.currentDeviceHash) FacebookAds.InterstitialAdManager.showAd("my placement id") .then(didClick => {console.log('click')}) .catch(error => {console.log(error)})
Or ` { FacebookAds.AdSettings.addTestDevice(FacebookAds.AdSettings.currentDeviceHash) } <FacebookAds.BannerAd placementId=“my placement id” type=“standard” onPress={() => console.log(‘click’)} onError={(error) => console.log(‘error’, error)} />
`
Here’s the error response:
`
“nativeEvent”: Object {
“code”: “ECOM.FACEBOOK.ADS.SDK1002”,
“domain”: “com.facebook.ads.sdk”,
“message”: “Ad was re-loaded too frequently”,
“nativeStackIOS”: Array [
“0 Exponent 0x0000000102d95acb ABI32_0_0RCTJSErrorFromCodeMessageAndNSError + 79”,
“1 Exponent 0x0000000102d95a49 ABI32_0_0RCTJSErrorFromNSError + 210”,
“2 Exponent 0x0000000102c8bb71 -[ABI32_0_0EXBannerView adView:didFailWithError:] + 50”,
“3 Exponent 0x0000000102ebbac2 -[FBAdView displayAdController:didFailWithError:] + 158”,
“4 libdispatch.dylib 0x000000010f6804e1 _dispatch_call_block_and_release + 12”,
“5 libdispatch.dylib 0x000000010f68154b _dispatch_client_callout + 8”,
“6 libdispatch.dylib 0x000000010f68d380 _dispatch_main_queue_callback_4CF + 1290”,
“7 CoreFoundation 0x000000010e5083e9 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9”,
“8 CoreFoundation 0x000000010e502a76 __CFRunLoopRun + 2342”,
“9 CoreFoundation 0x000000010e501e11 CFRunLoopRunSpecific + 625”,
“10 GraphicsServices 0x0000000110a6a1dd GSEventRunModal + 62”,
“11 UIKitCore 0x0000000117dbf81d UIApplicationMain + 140”,
“12 Exponent 0x0000000101e89d1d main + 80”,
“13 libdyld.dylib 0x000000010f6f1575 start + 1”,
],
“target”: 49,
“userInfo”: Object {
“FBAdErrorDetailKey”: Object {},
“NSLocalizedDescription”: “Ad was re-loaded too frequently”,
},
},
`
I am using SDK 32 and have facebookId and facebookDisplayName specified. Facebook login is working with the same FB app, so not sure why the ads are failing.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
I’ve same problem and also on Android. https://github.com/expo/expo/issues/1989#issuecomment-449816800
It worked on android changing the sdk version. But i couldn’t find a way to change version on IOS.
Thank you