A Heyzap plugin for React Native
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
android
hooks
ios
src
test
.codeclimate.yml
.editorconfig
.eslintignore
.eslintrc
.gitignore
.travis.yml
CHANGELOG.md
CONTRIBUTING.md
LICENSE
README.md
TODO.md
appveyor.yml
package.json

README.md

react-native-heyzap

Heyzap logo

npm version License Travis CI Code Climate Code Coverage Dependencies


Adds Heyzap integration to React Native on Android and iOS.

Requirements

  • node >= 4.1
  • rnpm >= 1.6

Installation

$ rnpm install react-native-heyzap

iOS

After rnpm has linked the package, there are still a few steps required.

Create a new group in your project called 'Frameworks', then right-click and select 'Add Files to...'. Find the HeyzapAds.framework file, and check the 'Copy items if needed' option.

Then go to 'Build Phases > Link Binary With Libraries' and add libxml2 and libsqlite3.

Finally, open 'Libraries' from the navigator, and expand Heyzap.xcodeproj. If it already has a HeyzapAds.framework file, remove it and re-add as before.

Usage

Add the following to your index.js:

let Heyzap = require('react-native-heyzap');

class AwesomeApp extends Component {

  showDebugPanel() {
    this.refs.hz.showDebugPanel();
  }

  fetchAd() {
    this.refs.hz.fetchAd();
  }

  showAd() {
    this.refs.hz.showAd();
  }

  render() {
    <View>
      <Heyzap ref="hz" publisherId='publisher-id' />
    </View>
  }
}

To call any methods on Heyzap, you must first retrieve its' reference as above. Once you have the reference, you can then call any of the following methods:

Heyzap.showDebugPanel();

// These methods return promises
Heyzap.showInterstitialAd();
Heyzap.fetchVideoAd();
Heyzap.showVideoAd();
Heyzap.fetchIncentivizedAd();
Heyzap.showIncentivizedAd();

Change log

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email contact@hassankhan.me instead of using the issue tracker.

Credits

  • [Hassan Khan][link-author]
  • [All Contributors][link-contributors]

License

The MIT License (MIT). Please see License File for more information.