Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem implementing Native Ads #355

Open
mohabouz opened this issue May 5, 2023 · 0 comments
Open

Problem implementing Native Ads #355

mohabouz opened this issue May 5, 2023 · 0 comments

Comments

@mohabouz
Copy link

mohabouz commented May 5, 2023

Bug Report

Before opening

  • [x ] Did you try the latest release?
  • [x ] Did you look for existing issues?

Ad Modules

Native Ads

Platforms
Android

Versions

  • Android: >9
  • react-native-fbads: 7.0.5
  • react-native: 0.70.8

Current Behaviour

1. I created a file for the component :

import React from 'react';
import { View, Text } from 'react-native';
import {
  withNativeAd,
  AdIconView,
  TriggerableView,
  MediaView,
} from 'react-native-fbads';

const AdComponent = ({ nativeAd }) => {
  return (
    <View>
      <AdIconView style={{ width: 50, height: 50 }} />
      <MediaView style={{ width: 160, height: 90 }} />
      <TriggerableView>
        <Text>{nativeAd.description}</Text>
      </TriggerableView>
    </View>
  );
};

export const MyNativeAd = withNativeAd(AdComponent);

1. Inside the screen where I want to display this ad :

import { InterstitialAdManager, AdSettings, NativeAdsManager } from 'react-native-fbads';
import { MyNativeAd } from 'components/NativeBanner';
...
let nativeAdsManager: NativeAdsManager =  new NativeAdsManager(PLACEMENT_ID);
...
export const Myscreen = () => {
  <View>
    <MyNativeAd adsManager={nativeAdsManager} nativeAd={???????} />
  </View>
}

As you can see in the code above, I must provide a nativeAd property to the MyNativeAd component.

Expected Behaviour
The created component should ask only for adsManager property, however it asks for nativeAd also, which is deferent from what the documentation shows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant