You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Run it on iOS / Android](#3-run-it-on-ios--android)
43
+
-[Install dependencies](#1-install-dependencies)
44
+
-[Start packager](#2-start-packager)
45
+
-[Run it on iOS / Android](#3-run-it-on-ios--android)
47
46
-[Credits](#credits)
48
47
49
48
## Installation
50
49
51
50
### 1. Install Javascript packages
51
+
52
52
##### RN >= 0.40
53
+
53
54
Install JavaScript packages:
54
55
55
56
```bash
56
57
$ react-native install react-native-fbads
57
58
```
59
+
58
60
##### RN < 0.40
61
+
59
62
Install JavaScript packages:
60
63
61
64
```bash
@@ -73,7 +76,6 @@ react-native link react-native-fbads
73
76
74
77
//IOS NOTICE
75
78
Use pod to install fbAudience framework
76
-
77
79
```
78
80
79
81
### 2. Configure native projects
@@ -111,7 +113,7 @@ import { InterstitialAdManager } from 'react-native-fbads';
111
113
112
114
InterstitialAdManager.showAd(placementId)
113
115
.then(didClick=> {})
114
-
.catch(error=> {})
116
+
.catch(error=> {});
115
117
```
116
118
117
119
Method returns a promise that will be rejected when an error occurs during a call (e.g. no fill from ad server or network error) and resolve when user either dimisses or interacts with the displayed ad.
@@ -134,12 +136,12 @@ const adsManager = new NativeAdsManager(placementId, numberOfAdsToRequest);
134
136
```
135
137
136
138
The constructor accepts two parameters:
139
+
137
140
-`placementId` - which is an unique identifier describing your ad units,
138
141
-`numberOfAdsToRequest` - which is a number of ads to request by ads manager at a time
139
142
140
143
#### 2. Making ad component
141
144
142
-
143
145
After creating `adsManager` instance, next step is to wrap an arbitrary component that you want to
144
146
use for rendering your custom advertises with a `withNativeAd` wrapper.
145
147
@@ -158,22 +160,26 @@ The `nativeAd` object can contain the following properties:
158
160
-`callToActionText` - Call to action phrase, e.g. - "Install Now"
159
161
-`socialContext` - social context for the Ad, for example "Over half a million users"
160
162
161
-
162
163
** Note: ** Don't use more than one MediaView/AdIconView component within one native ad.
163
164
164
165
** Note: ** To make any text `Triggerable` wrap it in <TriggerableView></TriggerableView> use only <Text /> component
0 commit comments