facebookarchive / facebook-instant-articles-sdk-php

The Facebook Instant Articles SDK for PHP provides a native interface for creating and publishing Instant Articles.
https://instantarticles.fb.com/
Other
232 stars 148 forks source link

FBInterstitialAd is gives all time "server error" #364

Closed pethanihiten closed 3 years ago

pethanihiten commented 3 years ago

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

Actual Result