项目作者: hoangdoan267

项目描述 :
Facebook InStream Ads for React Native
高级语言: Objective-C
项目地址: git://github.com/hoangdoan267/react-native-FBInStream.git
创建时间: 2017-04-10T08:09:38Z
项目社区:https://github.com/hoangdoan267/react-native-FBInStream

开源协议:

下载


Facebook InStream Ads

Installation

1. Install Javascript packages.

  1. $ yarn add react-native-facebook-instream-ads

Link to your project

  1. $ react-native link react-native-facebook-instream-ads

2. Downloading and linking the native Facebook SDK for iOS

Follow all the steps in the Getting Started Guide for Facebook SDK and Getting Started Guide for Facebook Audience for iOS.

Usage

  1. import { InStreamView } from 'react-native-facebook-instream-ads'
  2. export default class Example extends Component {
  3. handleSuccess = () => {
  4. //Handle when Ads loaded
  5. }
  6. handleError = () => {
  7. //Handle when Ads had err
  8. }
  9. render() {
  10. return (
  11. <View style={styles.container}>
  12. <InStreamView
  13. style={{"Your-own-style"}} //Optional.
  14. placementId={"your-placement-id"} //Required.
  15. onAdDone={() => this.handleSuccess()} //Required.
  16. onAdError={() => this.handleError()} //Required.
  17. />
  18. </View>
  19. );
  20. }
  21. }
  22. const styles = StyleSheet.create({
  23. container: {
  24. flex: 1,
  25. justifyContent: 'center',
  26. alignItems: 'center',
  27. backgroundColor: '#F5FCFF',
  28. },
  29. welcome: {
  30. fontSize: 20,
  31. textAlign: 'center',
  32. margin: 10,
  33. },
  34. instructions: {
  35. textAlign: 'center',
  36. color: '#333333',
  37. marginBottom: 5,
  38. },
  39. });

TODO

  • iOS
  • Android