@zvezdochots/react-native-yandex-mobile-ads
TypeScript icon, indicating that this package has built-in type declarations

0.3.3 • Public • Published

react-native-yandex-mobile-ads

Implementation Yandex ads for react native

Installation

Add the package to your project using either yarn:

yarn add react-native-yandex-mobile-ads

or npm:

npm install --save react-native-yandex-mobile-ads

Linking

React Native >= 0.60

CLI autolink feature links the module while building the app.

Note: for iOS make sure to install Pods through CocoaPods by running this command in your project's root directory: cd ios && pod install

For React-Native < 0.60 Link the native dependencies:
$ react-native link react-native-yandex-mobile-ads

Usage

import { BannerView, InterstitialAdManager } from 'react-native-yandex-mobile-ads';

<BannerView
  blockId={'R-M-DEMO-300x250'}
  size="BANNER_300x250"
  onLoad={() => console.log('onLoad')}
  onLeftApplication={() => console.log('onLeftApplication')}
  onReturnedToApplication={() => console.log('onReturnedToApplication')}
  onError={(err: any) => console.log('error', err)}
/>

InterstitialAdManager.showAd('R-M-DEMO-320x480')
  .then((didClick: boolean) => {
    console.log('clicked: ' + didClick);
  })
  .catch((error: any) => {
    console.log('error: ' + error);
  });

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Package Sidebar

Install

npm i @zvezdochots/react-native-yandex-mobile-ads

Weekly Downloads

1

Version

0.3.3

License

MIT

Unpacked Size

127 kB

Total Files

48

Last publish

Collaborators

  • zvezdochots