facebookarchive/facebook-instant-articles-sdk-php

FBInterstitialAd is gives all time "server error"

pethanihiten opened this issue · 0 comments

Steps required to reproduce the problem

-> We used Xcode 12.3 with the latest FB SDK
-> We using pod for installing SDK
pod 'FBAudienceNetwork'

-> Facebook banner and native ads work but in Interstitial got an error.
-> We check app ads id with "IMG_16_9_APP_INSTALL#YOUR_PLACEMENT_ID" , "YOUR_PLACEMENT_ID" and "VID_HD_9_16_39S_APP_INSTALL#1271929509856193_1285428311839646" but not getting any success.

  1. var interstitialAd: FBInterstitialAd?
  2. // MARK: - Ads Set
    func loadFacebookAdsInterstitial() {
    interstitialAd = FBInterstitialAd(placementID: "IMG_16_9_APP_INSTALL#YOUR_PLACEMENT_ID")
    interstitialAd!.delegate = self
    interstitialAd!.load()
    SVProgressHUD.show(withStatus: "Showing Ads")
    }

extension MGTemplateVC : FBInterstitialAdDelegate{

func interstitialAdDidLoad(_ interstitialAd: FBInterstitialAd) {
    print("Ad is loaded and ready to be displayed")
    SVProgressHUD.dismiss()
    if (interstitialAd.isAdValid) {
        interstitialAd.show(fromRootViewController: self)
    }
}

func interstitialAdWillLogImpression(_ interstitialAd: FBInterstitialAd) {
    print("The user sees the add")
    // Use this function as indication for a user's impression on the ad.
}

func interstitialAdDidClick(_ interstitialAd: FBInterstitialAd) {
    print("The user clicked on the ad and will be taken to its destination")
    // Use this function as indication for a user's click on the ad.
}

func interstitialAdWillClose(_ interstitialAd: FBInterstitialAd) {
    print("The user clicked on the close button, the ad is just about to close")
    // Consider to add code here to resume your app's flow
}

func interstitialAdDidClose(_ interstitialAd: FBInterstitialAd) {
    print("Interstitial had been closed")
    // Consider to add code here to resume your app's flow
}

func interstitialAd(_ interstitialAd: FBInterstitialAd, didFailWithError error: Error) {
    print("Ad failed to load \(error)")
    SVProgressHUD.dismiss()
}

}

Expected Result

  • got test ads.

Actual Result

  • Ad failed to load Error Domain=com.facebook.ads.sdk Code=2000 "Server Error" UserInfo={NSLocalizedDescription=Server Error, FBAdErrorDetailKey={
    code = 1;
    message = "An unknown error has occurred.";
    type = OAuthException;
    url = "https://graph.facebook.com/network_ads_common/";
    }}