# react-native-kidozads

> kidoz ads

Latest version **0.1.1** (published 2022-07-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-kidozads
pnpm add react-native-kidozads
yarn add react-native-kidozads
bun add react-native-kidozads
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2022-07-25 |
| First published | 2022-06-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Terry_J |
| Maintainers | terryje |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-kidozads
- Repository: https://github.com/availasoftNo1/react-native-kidozads
- Homepage: https://github.com/availasoftNo1/react-native-kidozads#readme
- Issues: https://github.com/availasoftNo1/react-native-kidozads/issues
- npm.io page: https://npm.io/package/react-native-kidozads

## Dependencies (1)

- [react-native-gesture-handler](https://npm.io/package/react-native-gesture-handler.md) ^2.4.2

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2022-07-25
- 0.1.0 — 2022-06-23

## README

# react-native-kidozads

kidoz ads

## Installation

```sh
npm install react-native-kidozads
```

## Usage

```js
import Kidozads from "react-native-kidozads";

  
  //Initialize SDK
  Kidozads.initialize(PID, TOKEN, (callback) => { 
    setIsInitialized(true);
    logStatus('SDK Initialized: '+ callback);

    // Attach ad listeners for rewarded ads, and banner ads
    attachAdListeners();//need to call removeEventListener to remove listeners.
  });
// ...

    //Attach ad Listeners for rewarded ads, and banner ads, and so on.
    function attachAdListeners() {
    Kidozads.addEventListener('onInterstitialDidFailToLoad', (adInfo) => {
      logStatus('Ad fail to Loaded ' );
    });


    Kidozads.addEventListener('onInterstitialDidFailToShow', (adInfo) => {
      //setKidozadshowCompleteState(adsShowState.completed);
      logStatus('Ads fail to show: ' +adInfo.error);
      
    });
    Kidozads.addEventListener('onInterstitialDidOpen', (adInfo) => {
      //setKidozadshowCompleteState(adsShowState.failed);
      logStatus('Ads did open');
      
    });
    Kidozads.addEventListener('onInterstitialDidShow', (adInfo) => {
      //setKidozadshowCompleteState(adsShowState.start);
      logStatus('Ads did show  ');
    });
    Kidozads.addEventListener('onDidClickInterstitial', (adInfo) => {
      //setKidozadshowCompleteState(adsShowState.click);
      logStatus('Ads did click');
    });
    Kidozads.addEventListener('onInterstitialDidClose', (adInfo) => {
      //setKidozadshowCompleteState(adsShowState.click);
      logStatus('Ads did close');
    });


    //reward video Listeners
    Kidozads.addEventListener('onRewardedVideoDidFailToShow', (adInfo) => {
      //setKidozadshowCompleteState(adsShowState.completed);
      logStatus('Ads fail to show' );
      
    });
    Kidozads.addEventListener('onRewardedVideoDidOpen', (adInfo) => {
      //setKidozadshowCompleteState(adsShowState.click);
      logStatus('Ads did open');
    });
    Kidozads.addEventListener('onRewardedVideoDidClose', (adInfo) => {
      //setKidozadshowCompleteState(adsShowState.completed);
      logStatus('closed: ' );
      
    });
    Kidozads.addEventListener('onRewardedVideoDidStart', (adInfo) => {
      //setKidozadshowCompleteState(adsShowState.click);
      logStatus('Ads did start');
    });
    Kidozads.addEventListener('onRewardedVideoDidEnd', (adInfo) => {
      //setKidozadshowCompleteState(adsShowState.click);
      logStatus('Ads did end');
    });
    Kidozads.addEventListener('onRewardedDidReciveError', (adInfo) => {
      //setKidozadshowCompleteState(adsShowState.completed);
      logStatus('on recive error: ');
      
    });
    Kidozads.addEventListener('onDidReceiveRewardForPlacement', (adInfo) => {
      //setKidozadshowCompleteState(adsShowState.completed);
      logStatus('did Receive Reward: ');
      
    });

   

    // Banner Ad Listeners
    Kidozads.addEventListener('onBannerDidLoad', (adInfo) => {
      logStatus('Banner ad loaded ');
      setIsNativeUIBannerShowing(!isNativeUIBannerShowing);
    });
    Kidozads.addEventListener('onBannerDidReciveError', (adInfo) => {
      logStatus('Banner did recive error ' );
    });
    Kidozads.addEventListener('onBannerDidFailToLoad', (adInfo) => {
      logStatus('Banner ad fail to loaded ' +adInfo.error);
    });
    Kidozads.addEventListener('onBannerDidOpen', (Info) => {
      logStatus('Banner will present screen ');
    });
    Kidozads.addEventListener('OndidClickBanner', (adInfo) => {
      logStatus('Banner ad clicked');
    });
    Kidozads.addEventListener('onBannerDidClose', (adInfo) => {
      logStatus('Banner full screen content dissmissed');
    });
    Kidozads.addEventListener('onBannerWillLeaveApplication', (adInfo) => {
      logStatus('Called when a user would be taken out of the application context');
    });
    
  //load interstitial ads：
  Kidozads.loadInterstitial();
  
  //load reward ads：
    Kidozads.loadRewardVideo();
    
　//load Banner:
　Kidozads.loadBottomBanner();
　
　ios: test with real devices

  For specific usage, please refer to example.
  How To Run example:
  1,$ cd example && npm install
  2,$ cd ios && pod install
  3,$ cd .. && npm run ios or npm run android

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---
_Source: https://npm.io/package/react-native-kidozads · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
