Doesn't work with react-native-admob after detaching
See original GitHub issueComplete 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:
- Created 6 years ago
- Comments:10 (7 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve made a simple example if anyone is finding it difficult to set up.
Thanks!