forked from ammarahm-ed/react-native-admob-native-ads
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc04273
commit 41edd43
Showing
38 changed files
with
11,873 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Website | ||
|
||
This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator. | ||
|
||
## Installation | ||
|
||
```console | ||
yarn install | ||
``` | ||
|
||
## Local Development | ||
|
||
```console | ||
yarn start | ||
``` | ||
|
||
This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
## Build | ||
|
||
```console | ||
yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. | ||
|
||
## Deployment | ||
|
||
```console | ||
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy | ||
``` | ||
|
||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
id: testdevice-2 | ||
title: isTestDevice | ||
sidebar_label: isTestDevice | ||
--- | ||
|
||
Check if the current device is registered as a test device to show test ads. | ||
|
||
```js | ||
AdManager.isTestDevice().then((result) => console.log(result)); | ||
``` | ||
|
||
return: `boolean` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
id: requestconfig-1 | ||
title: setRequestConfiguration | ||
sidebar_label: setRequestConfiguration | ||
--- | ||
|
||
Configure your Ad Requests during App Startup. You need to pass a single object as an argument with atleast one of the following properties | ||
|
||
### Properties | ||
|
||
| Name | Type | Required | | ||
| ---------------------------- | ------------------ | -------- | | ||
| testDeviceIds | `Array<string>` | no | | ||
| maxAdContentRating | Ad Content Ratings | no | | ||
| tagForChildDirectedTreatment | `boolean` | no | | ||
| tagForUnderAgeConsent | `boolean` | no | | ||
|
||
### Ad Content Ratings | ||
|
||
|
||
| Type | Description | | ||
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| G | "General audiences." Content suitable for all audiences, including families and children. | | ||
| MA | "Mature audiences." Content suitable only for mature audiences; includes topics such as alcohol, gambling, sexual content, and weapons. | | ||
| PG | "Parental guidance." Content suitable for most audiences with parental guidance, including topics like non-realistic, cartoonish violence. | | ||
| T | "Teen." Content suitable for teen and older audiences, including topics such as general health, social networks, scary imagery, and fight sports. | | ||
| UNSPECIFIED | Set default value to "" | | ||
|
||
### Usage example | ||
|
||
```js | ||
const config = { | ||
testDeviceIds: ["YOUR_TEST_DEVICE_ID"], | ||
maxAdContetRating: "MA", | ||
tagForChildDirectedTreatment: false, | ||
tagForUnderAgeConsent: false, | ||
}; | ||
|
||
AdManager.setRequestConfiguration(config); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
id: adbadge | ||
title: AdBadge | ||
sidebar_label: AdBadge | ||
--- | ||
|
||
Renders a small {Ad} badge on top-left corner of your ad showing the user that this is an Ad. | ||
|
||
```jsx | ||
import { AdBadge } from "react-native-admob-native-ads"; | ||
|
||
<AdBadge | ||
style={{ | ||
width: 15, | ||
height: 15, | ||
borderWidth: 1, | ||
borderRadius: 2, | ||
borderColor: "green", | ||
}} | ||
textStyle={{ | ||
fontSize: 9, | ||
color: "green", | ||
}} | ||
/>; | ||
``` | ||
|
||
## props | ||
|
||
### `style:ViewStyle` | ||
|
||
Style the outer `View` Component. | ||
|
||
### `textStyle:TextStyle` | ||
|
||
Style the inner `Text` Component | ||
|
||
### `allCaps` | ||
|
||
| Type | Required | Platform | | ||
| --------- | -------- | -------- | | ||
| `boolean` | no | All | | ||
|
||
Whether all text should be in capital letters | ||
|
||
:::caution | ||
|
||
If you do not render this view in your ad, your Admob account can get suspended or even banned for not telling your app users that what they are seeing is an Ad. | ||
|
||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
id: advertiser | ||
title: AdvertiserView | ||
sidebar_label: AdvertiserView | ||
--- | ||
|
||
Renders the advertiser name for the ad recieved from server. | ||
|
||
```jsx | ||
import { AdvertiserView } from "react-native-admob-native-ads"; | ||
|
||
<AdvertiserView | ||
style={{ | ||
fontWeight: "bold", | ||
fontSize: 10, | ||
}} | ||
/>; | ||
``` | ||
|
||
## props | ||
|
||
Inherits all the props from Text Component. | ||
|
||
### `allCaps` | ||
|
||
| Type | Required | Platform | | ||
| --------- | -------- | -------- | | ||
| `boolean` | no | All | | ||
|
||
Whether all text should be in capital letters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
id: calltoaction | ||
title: CallToActionView | ||
sidebar_label: CallToActionView | ||
--- | ||
|
||
Renders a CallToAction Button | ||
|
||
```jsx | ||
import { CallToActionView } from "react-native-admob-native-ads"; | ||
|
||
<CallToActionView | ||
style={{ | ||
height: 45, | ||
paddingHorizontal: 12, | ||
backgroundColor: "purple", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
borderRadius: 5, | ||
elevation: 10, | ||
}} | ||
textStyle={{ color: "white", fontSize: 14 }} | ||
/>; | ||
``` | ||
|
||
## props | ||
|
||
### `style:ViewStyle` | ||
|
||
Style the outer `View` Component. | ||
|
||
### `textStyle:TextStyle` | ||
|
||
Style the inner `Text` Component | ||
|
||
### `buttonAndroidStyle` | ||
|
||
Style the button on android using this prop. | ||
|
||
| Property | Type | Required | Platform | | ||
| --------------- | ----------------------------- | -------- | -------- | | ||
| backgroundColor | 6 digit hex color string only | No | All | | ||
| borderColor | 6 digit hex color string only | No | All | | ||
| borderWidth | `number` | No | All | | ||
| borderRadius | `number` | No | All | | ||
|
||
### `allowFontScaling` | ||
|
||
Allow font scaling on text | ||
|
||
### `allCaps` | ||
|
||
| Type | Required | Platform | | ||
| --------- | -------- | -------- | | ||
| `boolean` | no | All | | ||
|
||
Whether all text should be in capital letters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
id: headline | ||
title: HeadlineView | ||
sidebar_label: HeadlineView | ||
--- | ||
Renders the headline or title for the ad recieved from server. | ||
|
||
```jsx | ||
import { HeadlineView } from "react-native-admob-native-ads"; | ||
|
||
<HeadlineView | ||
style={{ | ||
fontWeight: "bold", | ||
fontSize: 13, | ||
}} | ||
/>; | ||
``` | ||
|
||
## props | ||
|
||
Inherits all the props from `Text` Component. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
id: icon | ||
title: IconView | ||
sidebar_label: IconView | ||
--- | ||
|
||
Renders an Image for the ad recieved from server. | ||
|
||
```jsx | ||
import { IconView } from "react-native-admob-native-ads"; | ||
|
||
<IconView | ||
style={{ | ||
width: 60, | ||
height: 60, | ||
}} | ||
/>; | ||
``` | ||
|
||
## props | ||
|
||
Inherits all the props from Image Component. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
id: image | ||
title: ImageView | ||
sidebar_label: ImageView | ||
--- | ||
|
||
Renders an Image for the ad recieved from server. | ||
|
||
```jsx | ||
import { ImageView } from "react-native-admob-native-ads"; | ||
|
||
<ImageView | ||
style={{ | ||
width: "100%", | ||
height: 250, | ||
}} | ||
/>; | ||
``` | ||
|
||
## props | ||
|
||
Inherits all the props from Image Component. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
id: media | ||
title: NativeMediaView | ||
sidebar_label: NativeMediaView | ||
--- | ||
|
||
Renders the `NativeMediaView` used for displaying video & image assets of the ad. | ||
|
||
```jsx | ||
import { NativeMediaView } from "react-native-admob-native-ads"; | ||
|
||
<MediaView | ||
style={{ | ||
width: "100%", | ||
height: 250, | ||
}} | ||
/>; | ||
``` | ||
|
||
## props | ||
|
||
### `style:ViewStyle` | ||
|
||
Style the outer `MediaView` Component. | ||
|
||
### `muted` | ||
|
||
Mute/unmute the video. | ||
|
||
| Type | Required | Platform | | ||
| --------- | -------- | -------- | | ||
| `boolean` | no | All | | ||
|
||
`default:false` | ||
|
||
### `pause` | ||
|
||
Pause/play the video | ||
|
||
| Type | Required | Platform | | ||
| --------- | -------- | -------- | | ||
| `boolean` | no | All | | ||
|
||
`default:false` | ||
|
||
## Events | ||
|
||
### `onVideoStart` | ||
|
||
Called when the video starts playing. | ||
|
||
### `onVideoEnd` | ||
|
||
Called when the video has ended. | ||
|
||
### `onVideoPause` | ||
|
||
Called when the video is paused. | ||
|
||
### `onVideoPlay` | ||
|
||
Called when the video starts playing. | ||
|
||
### `onVideoProgress` | ||
|
||
Returns with the `duration` and `currentTime` when the video is playing. | ||
|
||
| Type | Required | Platform | | ||
| ---------- | -------- | -------- | | ||
| `Progress` | no | All | | ||
|
||
`Progress:{ duration: string, currentTime: string }` | ||
|
||
### `onVideoMute` | ||
|
||
Called when the video is muted/unmuted. Returns current muted state. |
Oops, something went wrong.