1

I have been through SO and Google and back trying to figure this out, and I am very stuck.

I am trying to implement the Admob C++ SDK into my project on iOS with Xcode. The following code works correctly on Android, but not on iOS:

Advertisement::banner = new firebase::admob::BannerView();
      Game::log("Initializing..");
#ifdef _ANDROID_PLATFORM_
      Advertisement::banner->Initialize(Game::state->activity->clazz, kBannerAdUnit, banner_ad_size);
#else
      Advertisement::banner->Initialize(getUIView(), kBannerAdUnit, banner_ad_size);
#endif
      Game::log("Waiting for Initialize...");
      WaitForFutureCompletion(Advertisement::banner->InitializeLastResult());

      // Load the banner ad.
      Game::log("Loading a banner ad.");
      Advertisement::banner->LoadAd(request);

The error I'm getting is described as follows:

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)

Read below for what I have tried, what has worked, and what has not worked.

The Admob CPP Example

I downloaded the Admob example from here, and wow, it works! No errors, displays the banners fine, etc.

So after that worked, I scrapped my project, modified the example above to include my own app's content, and then I receive the HTTP load failed error above.

Note that I have manually checked that all of my settings are the same and that the plist file is the same. The only difference in the two applications is my non-Admob code (otherwise the admob code is identical), so that shouldn't be the issue. As I have been through it several times, I still cannot identify why this is happening.

plist

I have added to my plist file NSAllowsArbitraryLoads and also NSExceptionDomains for myProject.firebaseio.com described here and here with no success. It seems these do not impact the application, as I still receive HTTP load failed above.

I am not connecting to any HTTP site, only HTTPS, unless Admob does this automatically for the ads. It also seems I am not able to see to which site Admob is connecting, so I cannot test it with NSCurl.

I have tried this with both, the iPhoneX and 5s, and they show identical results.

halfer
  • 19,824
  • 17
  • 99
  • 186
Treyten Carey
  • 641
  • 7
  • 17
  • (Meta advice: this looks like a good question to me. However, editors will generally trim out meta/voting commentary in questions, since we'd rather voting was an organic as possible. It's always possible that someone might find a duplicate that you missed. We say the same about questions asking for upvotes, or asking readers not to downvote as well.) – halfer Apr 18 '18 at 22:37

0 Answers0