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.

Doesn't work with react-native-admob after detaching

See original GitHub issue

Complete issue here

Idk if its the issue with react-native-admob or expo or both so I’m creating it in both places

The following errors are produced -

Warning: Native component for "RNAdMob" does not exist

Warning: View.propTypes has been deprecated and will be removed in a future version of ReactNative. Use ViewPropTypes instead.

Warning: Native component for "RNAdMobDFP" does not exist

First I created a project using create-react-native-app which uses Expo then I detached using exp detach then I added react-native-admob using yarn add react-native-admob & then did react-native link

My Main File looks like this -

import React from 'react';
import { Font } from 'expo';
import { StyleSheet, Text, View } from 'react-native';
import { 
  AdMobBanner, 
  AdMobInterstitial, 
  PublisherBanner,
  AdMobRewarded
} from 'react-native-admob';

export default class App extends React.Component {
  state = {
    fontLoaded: false,
  };

  componentDidMount() {
    Font.loadAsync({
      'open-sans-bold': require('./assets/fonts/OpenSans-Bold.ttf'),
    }).then(_ => this.setState({ fontLoaded: true }));
  }

  render() {
    return (
      <View style={styles.container}>
        {
          this.state.fontLoaded ? (
            <View>
              <Text style={styles.text}>
                Open up App.js to start working on your app!
              </Text>
              <AdMobBanner
                bannerSize="fullBanner"
                adUnitID="ca-app-pub-1425926517331745/4411715717"
                testDeviceID="EMULATOR"
                didFailToReceiveAdWithError={this.bannerError} 
              />
            </View>
          ) : null
        }
      </View>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
  text: {
    fontFamily: 'open-sans-bold'
  }
});

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
deadcoder0904commented, Sep 26, 2017

I’ve made a simple example if anyone is finding it difficult to set up.

0reactions
jolocitycommented, Sep 25, 2017

Thanks!

On Sep 25, 2017, at 5:22 AM, Akshay Kadam notifications@github.com wrote:

Closed #325.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Doesn't work with react-native-admob after detaching #285
Hi there! For issues related to detaching it's best to followup on the expo repo, thanks for creating the issue there :) Please...
Read more >
Why react native admob not working in RN<57.8
After trying numerous times i guess react-native-admob isn't working in RN<57.8. So i found another way working in RN<57.8 is :.
Read more >
Set up a test device - Google AdMob Help
If you're using AdMob mediation or bidding, test mode applies to ads served from the AdMob Network only and does not apply to...
Read more >
Enabling test ads | Android - Google Developers
The quickest way to enable testing is to use Google-provided demo ad units. These ad units are not associated with your AdMob account,...
Read more >
Creating Full Screen Ad with Class API | React Native Admob ...
After the ad is created, ad will be loaded automatically if you didn't specify loadOnMounted option to false since its default value is...
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