question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't seem to get test ads to show up in iOS simulator

See original GitHub issue

I used a placementId from the FAN dashboard and am running on a simulator, I’m getting nothing.

          import { BannerView } from 'react-native-fbads';

          <BannerView
            placementId="my_placement_id"
            type="large"
            onClick={() => console.log('click')}
            onError={(err) => console.log('error', err)}
          />

Am using React Native 0.37 with the latest version of this library 4.0.0. When I try using 3.1.1, I get the error: "Element type is invalid: expected a string (for built-in components) or a class/function for composite components) but got: undefined

What am I missing?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
booboothefoolcommented, Mar 1, 2017

I got it!!!

This was crazy and way too difficult to set up. This was not documented anywhere. I had to read all over StackOverflow until I found this: http://stackoverflow.com/questions/33909430/how-to-test-facebook-audience-network-ads-over-testflight

I then added the snippets to my AppDelegate.m:

@import FBAudienceNetwork;
  NSLog(@"isTestMode1: %d",[FBAdSettings isTestMode]);
  NSString *testDeviceKey = [FBAdSettings testDeviceHash];
  if (testDeviceKey) {
    [FBAdSettings setLogLevel:FBAdLogLevelLog];
    [FBAdSettings addTestDevice:testDeviceKey];
  }

and voila!

screen shot 2017-02-28 at 7 02 13 pm

What gives? Everyone else got this to work without doing all that nonsense?

Btw, running

React Native 0.37
FacebookSDK 4.18.0
react-native-fbads 3.1.1
1reaction
grabboucommented, Mar 1, 2017

Well, in that case I think you can keep it inside AppDelegate.m and mark as to be removed when upgraded.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AdMob test banner loads on simulator, Only ... - Stack Overflow
I'm trying to test my AdMob/iAd singleton mediation. It works fine with test ads on simulator but AdMob never loads the test banner...
Read more >
Enabling test ads | iOS - Google Developers
This guide explains how to receive test ads in your ads integration. ... on ads in test mode will not show up in...
Read more >
Test ads not showing - Google Groups
Hello,. Test banner ads have stopped being served in beta versions of my iOS app. This is happening on devices and in the...
Read more >
AdMob Ad not showing up after publish - Apple Developer
Hello, I have some issues with my application. When I test my apps on emulator Ads appear normally and I also tested them...
Read more >
Test Reward ad not showing in iOS simulator - Google Support
Make sure that the account setup is fully completed. Name, address, phone number and tax info in your AdMob account with verification if ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found