[admob][android] WIP Basic view

This commit is contained in:
Elliot Hesp 2017-05-25 17:00:53 +01:00
parent 8df8f5a68c
commit 18774bbb40
6 changed files with 28 additions and 6 deletions

View File

@ -59,4 +59,5 @@ dependencies {
compile "com.google.firebase:firebase-crash:$firebaseVersion"
compile "com.google.firebase:firebase-config:$firebaseVersion"
compile "com.google.firebase:firebase-perf:$firebaseVersion"
compile "com.google.firebase:firebase-ads:$firebaseVersion"
}

View File

@ -9,10 +9,12 @@ import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.UIManagerModule;
import com.facebook.react.uimanager.ViewManager;
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;
import io.invertase.firebase.admob.RNFirebaseAdMob;
import io.invertase.firebase.auth.RNFirebaseAuth;
import io.invertase.firebase.config.RNFirebaseRemoteConfig;
import io.invertase.firebase.storage.RNFirebaseStorage;
@ -66,6 +68,8 @@ public class RNFirebasePackage implements ReactPackage {
*/
@Override
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
return Collections.emptyList();
return Arrays.<ViewManager>asList(
new RNFirebaseAdMob()
);
}
}

View File

@ -1,3 +1,5 @@
import Firebase from './lib/firebase';
export const AdMob = require('./lib/modules/admob');
export default Firebase;

View File

@ -0,0 +1,11 @@
import { PropTypes } from 'react';
import { requireNativeComponent, View } from 'react-native';
const Banner = {
name: 'Banner',
propTypes: {
src: PropTypes.string,
},
};
module.exports = requireNativeComponent('RNFirebaseAdMobBanner', Banner);

View File

@ -0,0 +1 @@
export const Banner = require('./Banner');

View File

@ -1,6 +1,8 @@
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { Banner } from './../firebase/modules/admob';
import CoreContainer from './containers/CoreContainer';
import setupStore from './store/setup';
import { setupSuites } from './tests/index';
@ -50,11 +52,12 @@ function bootstrap() {
return null;
}
return (
<Provider store={this.state.store}>
<CoreContainer />
</Provider>
);
return <Banner style={{ width: 100, height: 100, backgroundColor: 'pink'}} />;
// return (
// <Provider store={this.state.store}>
// <CoreContainer />
// </Provider>
// );
}
}