Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Follow the instructions on [react-native-fbsdk](https://github.com/facebook/reac

### Get a Placement ID

Follow [Facebook's instructions](https://www.facebook.com/help/publisher/1195459597167215) to create placement IDs for your ads.
Follow [Facebook's instructions](https://www.facebook.com/help/publisher/1195459597167215) to create placement IDs for your ads. In order to get test ads modify your placement ID as it shown [here](https://developers.facebook.com/docs/audience-network/guides/test/inserted-code).

### Add test devices and test users

Expand Down Expand Up @@ -237,11 +237,10 @@ class MainApp extends React.Component {

BannerView is a component that allows you to display ads in a banner format (know as _AdView_).

Banners are available in 3 sizes:
Banners are available in 2 sizes:

- `standard` (BANNER_HEIGHT_50)
- `large` (BANNER_HEIGHT_90)
- `rectangle` (RECTANGLE_HEIGHT_250) – currently Android only

```js
import { BannerView } from 'react-native-fbads';
Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ dependencies {
implementation 'com.facebook.react:react-native:+'
implementation "com.android.support:recyclerview-v7:${safeExtGet('supportLibVersion', '26.1.0')}"
implementation 'com.facebook.android:audience-network-sdk:6.2.+'
implementation 'com.facebook.android:facebook-android-sdk:5.15.+'
implementation 'com.facebook.android:facebook-android-sdk:6.+'
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ public void setSize(BannerView view, int size) {
case 90:
adSize = AdSize.BANNER_HEIGHT_90;
break;
case 250:
adSize = AdSize.RECTANGLE_HEIGHT_250;
break;
case 50:
default:
adSize = AdSize.BANNER_HEIGHT_50;
Expand Down
12 changes: 1 addition & 11 deletions example/src/BannerAds/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {Component} from 'react';
import {StyleSheet, View, Platform} from 'react-native';
import {StyleSheet, View} from 'react-native';
import {Container} from 'native-base';
import {BannerView} from 'react-native-fbads';
import {bannerAdPlacementId} from '../Variables';
Expand All @@ -24,16 +24,6 @@ export default class BannerAd extends Component {
onError={(err) => console.log('error', err)}
/>
</View>
{Platform.OS !== 'ios' ? (
<View style={styles.bannerContainer}>
<BannerView
placementId={bannerAdPlacementId}
type="rectangle"
onPress={() => console.log('click')}
onError={(err) => console.log('error', err)}
/>
</View>
) : null}
</Container>
);
}
Expand Down
2 changes: 0 additions & 2 deletions ios/ReactNativeAdsFacebook/EXBannerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ - (FBAdSize)fbAdSizeForHeight:(NSNumber *)height
switch ([height intValue]) {
case 90:
return kFBAdSizeHeight90Banner;
case 250:
return kFBAdSizeHeight250Rectangle;
case 50:
default:
return kFBAdSizeHeight50Banner;
Expand Down
5 changes: 2 additions & 3 deletions src/BannerViewManager.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { requireNativeComponent, StyleProp, ViewStyle } from 'react-native';

type AdType = 'large' | 'rectangle' | 'standard';
type AdType = 'large' | 'standard';

interface NativeBannerViewProps {
size: number;
Expand All @@ -28,8 +28,7 @@ const CTKBannerView = requireNativeComponent<NativeBannerViewProps>(

const sizeForType: Record<AdType, number> = {
large: 90,
rectangle: 250,
standard: 50
standard: 50,
};

const getSizeForType = (type: AdType) => sizeForType[type];
Expand Down