0

I am trying to implement Facebook native ads on my device. Test ads are working fine. However, production ads are not showing. It does displays an error showing

DiskCookieStorage changing policy from 2 to 0,cookie file: file:///private/var/mobile/Containers/Data/Application/9B89E486-EDF8-4E20-A7CE-CB60747C3E8B/Library/Cookies/Cookies.binarycookies

and

DiskCookieStorage changing policy from 0 to 2, cookie file: file:///private/var/mobile/Containers/Data/Application/9B89E486-EDF8-4E20-A7CE-CB60747C3E8B/Library/Cookies/Cookies.binarycookies

What I did is loading the ads in viewdidLoad

func setupFacebookNativeAds()
{
    let nativeAd = FBNativeAd(placementID: Constants.adMob.FB_NATIVE_ID)
    nativeAd.delegate = self
    nativeAd.loadAd()
}

What will be the issue here?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
fAiSaL
  • 754
  • 1
  • 10
  • 29
  • do you get any error? the FBNativeAd delegate has a ad failed method, print the error message in there – Scriptable Dec 17 '18 at 13:04
  • @Scriptable the delegate method for error is not calling. that means the ads are working fine, right? – fAiSaL Dec 17 '18 at 13:14
  • @Scriptable DiskCookieStorage changing policy from 0 to 2, cookie file: file:///private/var/mobile/Containers/Data/Application/5BF9095D-5B37-49F0-ABD9-8893F19AD53F/Library/Cookies/Cookies.binarycookies what Does this have to do with the error? – fAiSaL Dec 17 '18 at 13:15
  • yes, it probably just means that there wasn't an ad to show. i dont think that message that you have is an error, just a notification – Scriptable Dec 17 '18 at 13:17
  • @Scriptable, the test ads are working fine, whereas the production ads are not?... I mean the FBNativeAd delegate method not even calling? – fAiSaL Dec 17 '18 at 13:19
  • have you ensured that loadAd is definitely being called and added breakpoints to all of the delegate methods? are you testing on an actual device? – Scriptable Dec 17 '18 at 13:20
  • Yup, testing on the device. And I'm just calling the above method **setupFacebookNativeAds()** – fAiSaL Dec 17 '18 at 13:23
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/185362/discussion-between-faisal-and-scriptable). – fAiSaL Dec 17 '18 at 13:27
  • sorry i am on a secure network and cannot access chat currently. – Scriptable Dec 17 '18 at 13:28
  • Oops, there was a mistake from my side, I used different delegate for the error... – fAiSaL Dec 17 '18 at 13:30
  • Now after using the correct delegate, the error is printing like Error Domain=com.facebook.ads.sdk Code=1001 "No fill" UserInfo={NSLocalizedDescription=No fill, FBAdErrorDetailKey={ msg = "No fill"; }} – fAiSaL Dec 17 '18 at 13:30
  • no fill means there were no ads to show – Scriptable Dec 17 '18 at 13:30
  • @Scriptable, hey I found some on https://developers.facebook.com/docs/audience-network/testing. let me check that too – fAiSaL Dec 17 '18 at 13:36

1 Answers1

0

I found a solution by adding new test devices in the Monetisation Manager. Get the IDFA for the ios devices and add new test devices. Now the Native Ads view is working.

fAiSaL
  • 754
  • 1
  • 10
  • 29