Git Product home page Git Product logo

react-native-fbads's Introduction

react-native-fbads npm version

chat

Facebook Ads

Facebook Audience SDK integration for React Native, available on iOS and Android. Features native, interstitial and banner ads.

Table of Contents

Prerequisites

You must have Facebook developer account in order to start integrating your app with this library. If you don't have one sign up here.

Follow the instructions on react-native-fbsdk-next to integrate the Facebook SDK into your project.

Get a Placement ID

Follow Facebook's instructions to create placement IDs for your ads. In order to get test ads modify your placement ID as it shown here.

Add test devices and test users

Follow Facebook's instructions to add test devices and add test users.

Android

You can get AAID from the android device/emulator by going to Settings > Google > Ads.

iOS

You can get IDFA from the iOS device using a third party app from the App Store. For simulators IDFA can be obtained by running this command: xcrun simctl list 'devices' 'booted'.

Note: Simulator must be booted.

Installation

Add the package to your project using either yarn:

yarn add react-native-fbads

or npm:

npm install --save react-native-fbads

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-fbads

Expo installation

This package cannot be used in the "Expo Go" app because it requires custom native code.

First install the package with yarn, npm, or expo install.

expo install react-native-fbsdk-next react-native-fbads

After installing this npm package, add the config plugin to the plugins array of your app.json or app.config.js:

{
  "expo": {
    "plugins": [
      [
        "react-native-fbsdk-next",
        {
          "appID": "48127127xxxxxxxx",
          "clientToken": "c5078631e4065b60d7544a95xxxxxxxx",
          "displayName": "RN SDK Demo",
          "advertiserIDCollectionEnabled": false,
          "autoLogAppEventsEnabled": false,
          "isAutoInitEnabled": true,
          "iosUserTrackingPermission": "This identifier will be used to deliver personalized ads to you."
        }
      ],
      "react-native-fbads"
    ]
  }
}

Next, rebuild your app as described in the "Adding custom native code" guide.

Usage

Interstitial Ads

An Interstitial Ad is a an ad that covers the whole screen with media content. It has a dismiss button as well as the clickable area that takes user outside of your app.

Interstitial ads are displayed over your root view with a single, imperative call.

On android, you'll need to add the following to your AndroidManifest.xml:

<activity
  android:name="com.facebook.ads.InterstitialAdActivity"
  android:configChanges="keyboardHidden|orientation" />

Usage:

import { InterstitialAdManager } from 'react-native-fbads';

InterstitialAdManager.showAd(placementId)
  .then((didClick) => {})
  .catch((error) => {});

The showAd method returns a promise that will be resolves once the ad has been either dismissed or clicked by the user. The promise will reject if an error occurs before displaying the ad, such as a network error.

If you want to preload the ad and show it later you can use this instead:

import { InterstitialAdManager } from 'react-native-fbads';

InterstitialAdManager.preloadAd(placementId)
  .then((didClick) => {})
  .catch((error) => {});

// Will show it if already loaded, or wait for it to load and show it.
InterstitialAdManager.showPreloadedAd(placementId);

Native Ads

Native Ads allow you to create custom ad layouts that match your app. Before proceeding, please review Facebook's documentation on Native Ads to get a better understanding of the requirements Native Ads impose.

1. Create the ads manager

import { NativeAdsManager } from 'react-native-fbads';

const adsManager = new NativeAdsManager(placementId, numberOfAdsToRequest);

The constructor accepts two parameters:

  • placementId - which is an unique identifier describing your ad units,
  • numberOfAdsToRequest - which is a number of ads to request by ads manager at a time, defaults to 10.

2. Create your component

Your component will have access to the following properties, under the nativeAd prop:

  • advertiserName - The name of the Facebook Page or mobile app that represents the business running each ad.
  • headline - The headline that the advertiser entered when they created their ad. This is usually the ad's main title.
  • linkDescription - Additional information that the advertiser may have entered.
  • translation - The word 'ad', translated into the language based upon Facebook app language setting.
  • promotedTranslation - The word 'promoted', translated into the language based upon Facebook app language setting.
  • sponsoredTranslation - The word 'sponsored', translated into the language based upon Facebook app language setting.
  • bodyText - Ad body
  • callToActionText - Call to action phrase, e.g. - "Install Now"
  • socialContext - social context for the Ad, for example "Over half a million users"

In addition, you'll have access to the following components:

  • MediaView for displaying Media ads
  • AdIconView for displaying the ad's icon
  • AdChoicesView for displaying the Facebook AdChoices icon.
  • TriggerableView for wrapping Text so it will respond to user clicks.

Please ensure you've reviewed Facebook's instructions to get a better understanding of each of these components and how you should use them.

import {
  AdIconView,
  MediaView,
  AdChoicesView,
  TriggerableView,
} from 'react-native-fbads';
class AdComponent extends React.Component {
  render() {
    return (
      <View>
        <AdChoicesView style={{ position: 'absolute', left: 0, top: 0 }} />
        <AdIconView style={{ width: 50, height: 50 }} />
        <MediaView style={{ width: 160, height: 90 }} />
        <TriggerableView>
          <Text>{this.props.nativeAd.description}</Text>
        </TriggerableView>
      </View>
    );
  }
}

export default withNativeAd(AdComponent);

4. Displaying Facebook Ad Choices Icon

Facebook's guidelines require every native ad to include the Ad Choices view, which contains a small clickable icon. You can use the included AdChoicesView component and style it to your liking.

Example usage

import { AdChoicesView } from 'react-native-fbads';

<AdChoicesView style={{ position: 'absolute', left: 0, top: 0 }} />;

Props

prop default required description
style undefined false Standard Style prop
expandable false false (iOS only) makes the native AdChoices expandable
location topLeft false (iOS only) controls the location of the AdChoices icon

5. Showing the ad

Finally, wrap your component with the withNativeAd HOC and pass it the adsManager you've previously created.

class MyAd {
 ...
}
export const AdComponent = withNativeAd(MyAd);

class MainApp extends React.Component {
  render() {
    return (
      <View>
        <AdComponent adsManager={adsManager} />
      </View>
    );
  }
}

BannerView

BannerView is a component that allows you to display ads in a banner format (know as AdView).

Banners are available in 2 sizes:

  • standard (BANNER_HEIGHT_50)
  • large (BANNER_HEIGHT_90)
import { BannerView } from 'react-native-fbads';

function ViewWithBanner(props) {
  return (
    <View>
      <BannerView
        placementId="YOUR_BANNER_PLACEMENT_ID"
        type="standard"
        onPress={() => console.log('click')}
        onLoad={() => console.log('loaded')}
        onError={(err) => console.log('error', err)}
      />
    </View>
  );
}

API

NativeAdsManager

Provides a mechanism to fetch a set of ads and then use them within your application. The native ads manager supports giving out as many ads as needed by cloning over the set of ads it got back from the server which can be useful for feed scenarios. It's a wrapper for FBNativeAdsManager

disableAutoRefresh

By default the native ads manager will refresh its ads periodically. This does not mean that any ads which are shown in the application's UI will be refreshed but simply that requesting next native ads to render may return new ads at different times. This method disables that functionality.

adsManager.disableAutoRefresh();

setMediaCachePolicy

Sets the native ads manager caching policy. This controls which media from the native ads are cached before being displayed. The default is to not block on caching.

adsManager.setMediaCachePolicy('none' | 'icon' | 'image' | 'all');

Note: This method is a noop on Android

AdSettings

import { AdSettings } from 'react-native-fbads';

AdSettings contains global settings for all ad controls.

currentDeviceHash

Constant which contains current device's hash id.

addTestDevice

Registers given device to receive test ads. When running on a real device, call this method with the result of AdSettings.currentDeviceHash to get test ads. Do not call this method in production.

You should register test devices before displaying any ads or creating any ad managers.

AdSettings.addTestDevice('hash');

clearTestDevices

Clears all previously set test devices. If you want your ads to respect newly set config, you'll have to destroy and create an instance of AdsManager once again.

AdSettings.clearTestDevices();

setLogLevel

Sets current SDK log level.

AdSettings.setLogLevel(
  'none' | 'debug' | 'verbose' | 'warning' | 'error' | 'notification'
);

Note: This method is a noop on Android.

setIsChildDirected

Configures the ad control for treatment as child-directed.

AdSettings.setIsChildDirected(true | false);

setMediationService

If an ad provided service is mediating Audience Network in their sdk, it is required to set the name of the mediation service

AdSettings.setMediationService('foobar');

setUrlPrefix

Sets the url prefix to use when making ad requests.

AdSettings.setUrlPrefix('...');

Note: This method should never be used in production

getTrackingStatus

Gets the current Tracking API status. As of iOS 14, Apple requires apps to only enable tracking (advertiser ID collection) when the user has granted tracking permissions.

Requires iOS 14. On Android and iOS versions below 14, this will always return 'unavailable'.

const trackingStatus = await AdSettings.getTrackingStatus();
if (trackingStatus === 'authorized' || trackingStatus === 'unavailable') {
  AdSettings.setAdvertiserIDCollectionEnabled(true);
}

The tracking status can return one of the following values:

  • 'unavailable': The tracking API is not available on the current device. That's the case on Android devices and iPhones below iOS 14.
  • 'denied': The user has explicitly denied permission to track. You'd want to respect that and disable advertiser ID collection.
  • 'authorized': The user has granted permission to track. You can now enable advertiser ID collection.
  • 'restricted': The tracking permission alert cannot be shown, because the device is restricted. See ATTrackingManager.AuthorizationStatus.restricted for more information.
  • 'not-determined': The user has not been asked to grant tracking permissions yet. Call requestTrackingPermission().

requestTrackingPermission

Requests permission to track the user. Requires an NSUserTrackingUsageDescription key in your Info.plist. (See iOS 14 Tracking API)

Requires iOS 14. On Android and iOS versions below 14, this will always return 'unavailable'.

const trackingStatus = await AdSettings.requestTrackingPermission();
if (trackingStatus === 'authorized' || trackingStatus === 'unavailable') {
  AdSettings.setAdvertiserIDCollectionEnabled(true);
  AdSettings.setAdvertiserTrackingEnabled(true);
}

setAdvertiserTrackingEnabled

Enables or disables personalized ads tracking on iOS 14+. See Facebook docs on Advertising Tracking Enabled For Audience Network

Requires iOS 14. On Android and iOS versions below 14, this will always be no-op. Important: FB won't display adds unless this is set to true.

AdSettings.setAdvertiserTrackingEnabled(true);

setAdvertiserIDCollectionEnabled

Enables or disables automatic advertiser ID collection. Since the iOS 14 API was introduced, you might want to disable advertiser ID collection per default (in Info.plist), and only enable it once the user has granted tracking permissions.

AdSettings.setAdvertiserIDCollectionEnabled(true);

Running the example

In order to see ads you will have to create your own placementId and use it instead of the one provided in the examples. This is our internal set up that doesn't work for any developers outside of Callstack.io organisation. This is because of Facebook not showing test ads to outside collaborators in the development mode.

1. Install dependencies

$ npm install

2. Start packager

Because of the way example project is set up (custom packager arguments), you'll have to start it explicitly before any other command

$ cd ./example && npm start

3. Run it on iOS / Android

$ cd ./example && npm run ios
$ cd ./example && npm run android

Credits

Some of the API explanations were borrowed from Facebook SDK documentation.

react-native-fbads's People

Contributors

7kfpun avatar dependabot[bot] avatar dev-two avatar elvischiang avatar erandagan avatar giautm avatar grabbou avatar hackrx avatar haxonadora avatar jakubsta avatar jobeso avatar lgn-lvx3 avatar lutherdiaz avatar mehuleo avatar michalkvasnicak avatar mikenso avatar misaalturakhia avatar mrousavy avatar ohtangza avatar pedroordep avatar radko93 avatar rodolfogs avatar satya164 avatar suraj-tiwari avatar thymikee avatar tmaszko avatar trancever avatar vira-khdr avatar wojteg1337 avatar yukaii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-native-fbads's Issues

CTKAdSettingsManager.currentDeviceHash undefined is not an object

Launching app and getting crash

I don't setup AdSetting, just render:

import { BannerView } from 'react-native-fbads';

function ViewWithBanner(props) {
  return (
    <View>
      <BannerView
        placementId="YOUR_BANNER_PLACEMENT_ID"
        type="standard"
        onClick={() => console.log('click')}
        onError={(err) => console.log('error', err)}
      />
    </View>
  );
}

simulator screen shot apr 10 2017 5 53 02 am

Android install does not work

Hi, the supplied method of install (react-native install ...) does not work.
Please supply manual instructions for installing in Android.

Thanks!

Warning: Can only update a mounted or mounting component.

I'm getting this warning, referring to the file withNativeAd. Perhaps it's referring to the timeout presented in NativeAdsManager within the method onAdsLoaded. But I don't really have a solution to help with.

Just leaving here the screenshot so can anyone track the warning.

simulator screen shot 9 jun 2017 10 30 39

[Request] Support for AdChoices view

According to the Design Guidelines from Facebook it is best practice to have the AdChoices icon present in your native ad. It also has some behavior when clicked.

AdChoices

There is already a native view available in the SDK.

It'd be great to see this wrapped as a React Native component. Has anyone already tried this? Just curious if it had not been wrapped already intentionally.

Why banner ads not shown

I tried to show a banner for testing but there is only a blank banner at the bottom of screen. No ad at all.

Is there additional steps required to test ads?

Thanks,

RN code:

<BannerView
          type="standard"
          placementId="abc_xyz"
          onClick={() => console.log('click')}
          onError={(err) => console.log('error', err)}
/>

My placement for this banner (removed placement ID):

screen shot 2017-05-23 at 2 47 32 pm

error with didFailWithError

i am getting this error for most of the time, it works mostly though -

screenshot at jul 04 02-46-37

any thoughts how we could fix this?

[SOLVED] Duplicate zip entry - play-services-ads dependency outdated

Hey

So by build is not building and the error I am getting is this:

Warning: Exception while processing task java.io.IOException: Can't write [XXXXXXXXXX/android/app/build/intermediates/transforms/proguard/debug/jars/3/1f/main.jar] (Can't read [XXXXXXXXXXXXXXX/android/app/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads/8.4.0/jars/classes.jar(;;;;;;**.class)] (Duplicate zip entry [classes.jar:com/google/android/gms/internal/zzah.class]))
:app:transformClassesAndResourcesWithProguardForDebug FAILED

I read on the Internet that it could be due to some other modules or dependencies in other projects using a different version, which was true, since I am also using react-native-maps which was using 8.4.0 version but recently that had to be updated.

I searched everywhere for this play-services-ads group dependency but I couldn't find it, until I did in the andorid.iml file as an exported module (I guess added by the Android API 23, not sure here)

<orderEntry type="library" exported="" name="play-services-ads-8.4.0" level="project" />

I couldn't find this in either gradle files and I even tried to sync gradle/iml files but I couldn't.

I fixed it in app.gradle changing this:

    compile project(':react-native-fbsdk')

to this:

    compile (project(':react-native-fbsdk')) {
        exclude group: 'com.google.android.gms', module: 'play-services-ads'
    }
    compile "com.google.android.gms:play-services-ads:10.2.0"

Android launch page ads

When the request for an AD callback is not returned,AsyncStorage unoperation๏ผŒAsynchronous operations are blocked

Implement additional `FBNativeAdManager` API

For now it's just a proxy to the native manager in order to handle loaded events. Expose other properties, like controlling cache policy or explicitly calling loadAds so that the full control is handed over to Javascript.

Android was not automatically link

I use react-native link for our library but it just automatically linked to my ios project, on Android version, I had to manually link.
But it throw an error: "io.callstack.react.fbads.FBAdsPackage" does not exist.

build broken with latest sdk (4.22.0)

compile 'com.facebook.android:audience-network-sdk:4.+'

The library dependency refers to all 4.* version
it's broken at 4.22.0 (fine with 4.20.0)

/Users/elvis/work/XXX/node_modules/react-native-fbads/src/android/src/main/java/io/callstack/react/fbads/BannerView.java:21: error: BannerView is not abst
ract and does not override abstract method onLoggingImpression(Ad) in AdListener
public class BannerView extends ReactViewGroup implements AdListener, LifecycleEventListener {
       ^
/Users/elvis/work/XXX/node_modules/react-native-fbads/src/android/src/main/java/io/callstack/react/fbads/InterstitialAdManager.java:13: error: Interstitia
lAdManager is not abstract and does not override abstract method onLoggingImpression(Ad) in AdListener
public class InterstitialAdManager extends ReactContextBaseJavaModule implements InterstitialAdListener, LifecycleEventListener {
       ^
Note: /Users/elvis/work/cybertool/node_modules/react-native-fbads/src/android/src/main/java/io/callstack/react/fbads/BannerViewManager.java uses unchecked or un
safe operations.

This method must be called on the main thread was thrown while invoking showAd

Trying to load an interstitial ad, on touchable opacity press. Displays the error shown in the issue title.

Exception 'This method must be called on the main thread' was thrown while invoking showAd on target CTKInterstitialAdManager with params ( "PLACEMENTID", 30, 31 )

              onPress = {
                () => {
                  this.showFullScreenAd()
                }
              }
  showFullScreenAd() {
    InterstitialAdManager.showAd("PLACEMENT_ID_WAS_HERE").then(didClick => {}).catch(error => {});
  }

[Suggest] Add Search Path Framework

Please add search path framework in build setting for IOS like react-native-fbsdk for implementing FBSDK:
$(PROJECT_DIR)/../../../ios/Frameworks

How to check if a native ad was not filled (to show another ad)?

I tried checking the nativeAd but it doesn't work:

const FullNativeAd = withNativeAd(({ nativeAd }) => {
  if (_.isEmpty(nativeAd)) {
    return (
      <MyCustomAd />
    );
  }

  return (
    <View style={styles.container}>
      {nativeAd.icon && (
        <Image style={styles.icon} source={{ uri: nativeAd.icon }} />
      )}
      <View style={styles.info}>
        <Text style={styles.title}>{nativeAd.title}</Text>
        {nativeAd.subtitle && (
          <Text style={styles.subtitle}>{nativeAd.subtitle}</Text>
        )}
        {nativeAd.description && (
          <Text style={styles.description}>{nativeAd.description}</Text>
        )}
        <Text style={styles.callToActionText}>{nativeAd.callToActionText}</Text>
      </View>
    </View>
  );
});

module FBAudienceNetwork not found

Entirely frustrating issue. The project is linked. The frameworks are in the frameworks folder. Framework search path is updated to reflect the location of the frameworks, yet rn-fbads "CTKInterstitialAdManager.m' fails to build due to FBAudienceNetwork not found.

screen shot 2017-03-03 at 9 26 15 pm
screen shot 2017-03-03 at 9 26 48 pm

Android support

Open source internal Android code along with the tweaks that were applied in the open source version.

ETA: this week

E_FAILED_TO_LOAD: FBAdErrorDetailKey No fill

Environment

  • XCode 8.2
  • React Native 0.35
  • react-native-fbads 3.1.1

Problem

I setup sdk and build successfully, but get this runtime error.

I print it out as the snippet below:

InterstitialAdManager.showAd('my_InterstitialAd_id')
  .then(didClick => {})
  .catch(error => {
    alert(JSON.stringify((error)))
})

screen shot 2016-12-20 at 3 54 04 pm

I googled "No fill FB Audience SDK", and the results taught me to add something like:

[FBAdSettings addTestDevice:@"HASH_ID"]

But I can't get hash id from XCode console. And as you mentioned in README addTestDevice section:

When you run app on simulator, it automatically gets added

How can I solve this problem? Thank you in advance.

[Request] Do not use `constantsToExport` on iOS

We currently export current device hash, so that it can be passed to addTestDevice:. We could change it in a way that addTestDevice: accepts a string of value "current" and we check for that value on a native side.

Update to latest React Native

Update the iOS build part, what we should do is we should use <React/...> imports everywhere. We should not export any headers outside of this package as we are not making them reusable.

Otherwise, export under <RCTFBAds/...>

Got "undefined is not an object.." error

react native 0.36
`import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';

import { NativeAdsManager } from 'react-native-fbads';
const adsManager = new NativeAdsManager(MY_PLACE_ID, 1);
...
`
screen shot 2016-10-30 at 4 30 53 am
Followed all the steps.

Error: No fill

Based on another issue submitted (#24), this seems to be because an ad request hasn't been sent. I'm assuming this is only because I haven't sent a request with a real device and I'm just testing. According to the documentation, "When you run app on simulator, it automatically gets added. [as a test device]" It seems like it's not getting added as a test device.

Any help is appreciated.

Error: No fill
    at createErrorFromErrorData (NativeModules.js:116)
    at NativeModules.js:79
    at MessageQueue.__invokeCallback (MessageQueue.js:276)
    at MessageQueue.js:127
    at guard (MessageQueue.js:46)
    at MessageQueue.invokeCallbackAndReturnFlushedQueue (MessageQueue.js:126)
    at debuggerWorker.js:71

Unable to show Ads

I tried to display native ads and interstitial ads, both of them got the similar error:
undefined is not an object ( evaluating CTKNativeAdManager.init)
undefined is not an object ( evaluating _reactNativeFbads.InterstitialAdManager.showAd)

Handle delegate events

Since they are fbAdsManager unspecific, loop over the entire list of all adManagers and return a map of its states. That way, we know which of them really became valid.

Crashing for me on Android 4.3 (works on more recent versions)

    "react-native": "0.37.0",
    "react-native-fbads": "3.1.1",
    "react-native-fbsdk": "^0.5.0",

Crashes from adding this code:

import { NativeAdsManager } from 'react-native-fbads';
const adsManager = new NativeAdsManager('my_placement_id');
W/dalvikvm( 9296): Invalid indirect reference 0xa4fdcc00 in decodeIndirectRef
I/dalvikvm( 9296): "main" prio=5 tid=1 RUNNABLE
I/dalvikvm( 9296):   | group="main" sCount=0 dsCount=0 obj=0xa4b86480 self=0xb79b6bd0
I/dalvikvm( 9296):   | sysTid=9296 nice=-4 sched=0/0 cgrp=[fopen-error:2] handle=-1217191904
I/dalvikvm( 9296):   | state=R schedstat=( 172387119 425972608 908 ) utm=10 stm=6 core=0
I/dalvikvm( 9296):   at android.webkit.CookieManagerClassic.nativeAcceptCookie(Native Method)
I/dalvikvm( 9296):   at android.webkit.CookieManagerClassic.acceptCookie(CookieManagerClassic.java:49)
I/dalvikvm( 9296):   at com.facebook.ads.internal.f.e.<init>((null):-1)
I/dalvikvm( 9296):   at com.facebook.ads.internal.f.e.a((null):-1)
I/dalvikvm( 9296):   at com.facebook.ads.internal.server.c.a((null):-1)
I/dalvikvm( 9296):   at com.facebook.ads.internal.server.c.a((null):-1)
I/dalvikvm( 9296):   at com.facebook.ads.internal.server.a.a((null):-1)
I/dalvikvm( 9296):   at com.facebook.ads.internal.server.a.a((null):-1)
I/dalvikvm( 9296):   at com.facebook.ads.internal.server.a$2.a((null):-1)
I/dalvikvm( 9296):   at com.facebook.ads.internal.i.a.h.a((null):-1)
I/dalvikvm( 9296):   at com.facebook.ads.internal.i.a.h.onPostExecute((null):-1)
I/dalvikvm( 9296):   at android.os.AsyncTask.finish(AsyncTask.java:631)
I/dalvikvm( 9296):   at android.os.AsyncTask.access$600(AsyncTask.java:177)
I/dalvikvm( 9296):   at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
I/dalvikvm( 9296):   at android.os.Handler.dispatchMessage(Handler.java:99)
I/dalvikvm( 9296):   at android.os.Looper.loop(Looper.java:137)
I/dalvikvm( 9296):   at android.app.ActivityThread.main(ActivityThread.java:5103)
I/dalvikvm( 9296):   at java.lang.reflect.Method.invokeNative(Native Method)
I/dalvikvm( 9296):   at java.lang.reflect.Method.invoke(Method.java:525)
I/dalvikvm( 9296):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
I/dalvikvm( 9296):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
I/dalvikvm( 9296):   at dalvik.system.NativeStart.main(Native Method)
I/dalvikvm( 9296):
E/dalvikvm( 9296): VM aborting
F/libc    ( 9296): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 9296 (mycompany.myapp)
I/DEBUG   ( 3470): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   ( 3470): Build fingerprint: 'generic/vbox86p/vbox86p:4.3/JLS36G/eng.genymotion.20160825.132445:userdebug/test-keys'
I/DEBUG   ( 3470): Revision: '0'
I/DEBUG   ( 3470): pid: 9296, tid: 9296, name: mycompany.myapp  >>> com.mycompany.myapp <<<
I/DEBUG   ( 3470): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadd00d
I/DEBUG   ( 3470):
I/DEBUG   ( 3470): backtrace:
I/DEBUG   ( 3470):     #00  pc 00071022  /system/lib/libdvm.so (dvmAbort+194)
I/DEBUG   ( 3470):     #01  pc 0007605d  /system/lib/libdvm.so (_Z20dvmDecodeIndirectRefP6ThreadP8_jobject.part.36+77)
I/DEBUG   ( 3470):     #02  pc 0007d8c1  /system/lib/libdvm.so (GetStringUTFChars(_JNIEnv*, _jstring*, unsigned char*)+97)
I/DEBUG   ( 3470):     #03  pc 00535321  /system/lib/libwebcore.so (android::jstringToStdString(_JNIEnv*, _jstring*)+81)
I/DEBUG   ( 3470):     #04  pc 00512d18  /system/lib/libwebcore.so (android::databaseDirectory(bool)+1048)
I/DEBUG   ( 3470):     #05  pc ffffffff  <unknown>
I/DEBUG   ( 3470):
I/DEBUG   ( 3470): stack:
I/DEBUG   ( 3470):          bf808b60  00000000
I/DEBUG   ( 3470):          bf808b64  00000000
I/DEBUG   ( 3470):          bf808b68  00000000
I/DEBUG   ( 3470):          bf808b6c  00000000
I/DEBUG   ( 3470):          bf808b70  00000000
I/DEBUG   ( 3470):          bf808b74  00000000
I/DEBUG   ( 3470):          bf808b78  00000000
I/DEBUG   ( 3470):          bf808b7c  00000000
I/DEBUG   ( 3470):          bf808b80  00000000
I/DEBUG   ( 3470):          bf808b84  00000000
I/DEBUG   ( 3470):          bf808b88  00000000
I/DEBUG   ( 3470):          bf808b8c  00000000
I/DEBUG   ( 3470):          bf808b90  00000000
I/DEBUG   ( 3470):          bf808b94  00000000
I/DEBUG   ( 3470):          bf808b98  00000000
I/DEBUG   ( 3470):          bf808b9c  46505845
I/DEBUG   ( 3470):     #00  bf808ba0  00000000
I/DEBUG   ( 3470):          bf808ba4  b6137421  /system/lib/libdvm.so
I/DEBUG   ( 3470):          bf808ba8  b6138894  /system/lib/libdvm.so
I/DEBUG   ( 3470):          bf808bac  00000000
I/DEBUG   ( 3470):          bf808bb0  b7c8ad28  [heap]
I/DEBUG   ( 3470):          bf808bb4  b6137421  /system/lib/libdvm.so
I/DEBUG   ( 3470):          bf808bb8  b613790b  /system/lib/libdvm.so
I/DEBUG   ( 3470):          bf808bbc  6c756e28
I/DEBUG   ( 3470):          bf808bc0  0000296c
I/DEBUG   ( 3470):          bf808bc4  00000000
I/DEBUG   ( 3470):          bf808bc8  00000000
I/DEBUG   ( 3470):          bf808bcc  00000000
I/DEBUG   ( 3470):          bf808bd0  00000000
I/DEBUG   ( 3470):          bf808bd4  00000000
I/DEBUG   ( 3470):          bf808bd8  00000000
I/DEBUG   ( 3470):          bf808bdc  00000000
I/DEBUG   ( 3470):          ........  ........
I/DEBUG   ( 3470):     #01  bf808dd0  b79b6bd0  [heap]
I/DEBUG   ( 3470):          bf808dd4  00000000
I/DEBUG   ( 3470):          bf808dd8  b6145838  /system/lib/libdvm.so
I/DEBUG   ( 3470):          bf808ddc  a4fdcc00  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   ( 3470):          bf808de0  b79b6bd0  [heap]
I/DEBUG   ( 3470):          bf808de4  b603a016  /system/lib/libdvm.so (_Z20dvmDecodeIndirectRefP6ThreadP8_jobject.part.36+6)
I/DEBUG   ( 3470):          bf808de8  b6185ccc  /system/lib/libdvm.so
I/DEBUG   ( 3470):          bf808dec  b60418c2  /system/lib/libdvm.so (GetStringUTFChars(_JNIEnv*, _jstring*, unsigned char*)+98)
I/DEBUG   ( 3470):     #02  bf808df0  b79b6bd0  [heap]
I/DEBUG   ( 3470):          bf808df4  a4fdcc00  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   ( 3470):          bf808df8  00000012
I/DEBUG   ( 3470):          bf808dfc  b6059b79  /system/lib/libdvm.so (dvmChangeStatus(Thread*, ThreadStatus)+25)
I/DEBUG   ( 3470):          bf808e00  b75a06c0
I/DEBUG   ( 3470):          bf808e04  99aa3734  /system/lib/libwebcore.so
I/DEBUG   ( 3470):          bf808e08  00000016
I/DEBUG   ( 3470):          bf808e0c  b6059b79  /system/lib/libdvm.so (dvmChangeStatus(Thread*, ThreadStatus)+25)
I/DEBUG   ( 3470):          bf808e10  b79b6bd0  [heap]
I/DEBUG   ( 3470):          bf808e14  0000003c
I/DEBUG   ( 3470):          bf808e18  bf808e00  [stack]
I/DEBUG   ( 3470):          bf808e1c  00000001
I/DEBUG   ( 3470):          bf808e20  00000000
I/DEBUG   ( 3470):          bf808e24  9ddfb748  /dev/ashmem/dalvik-LinearAlloc (deleted)
I/DEBUG   ( 3470):          bf808e28  0000000c
I/DEBUG   ( 3470):          bf808e2c  99e8a174  /system/lib/libwebcore.so
I/DEBUG   ( 3470):          ........  ........
I/DEBUG   ( 3470):
I/DEBUG   ( 3470): memory map around fault addr deadd00d:
I/DEBUG   ( 3470):     bf7ea000-bf80b000 rw- [stack]
I/DEBUG   ( 3470):     (no map for address)
I/DEBUG   ( 3470):     (no map above)
I/BootReceiver(  332): Copying /data/tombstones/tombstone_06 to DropBox (SYSTEM_TOMBSTONE)
W/ActivityManager(  332):   Force finishing activity com.mycompany.myapp/.MainActivity
W/InputDispatcher(  332): channel '529a1e7c com.mycompany.myapp/com.mycompany.myapp.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
E/InputDispatcher(  332): channel '529a1e7c com.mycompany.myapp/com.mycompany.myapp.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
D/        (  332): HostConnection::get() New Host Connection established 0xb7a01f78, tid 9372
D/Zygote  (  172): Process 9296 terminated by signal (11)
D/dalvikvm(  332): GC_FOR_ALLOC freed 2427K, 56% free 11576K/25772K, paused 11ms, total 12ms
W/InputDispatcher(  332): Attempted to unregister already unregistered input channel '529a1e7c com.mycompany.myapp/com.mycompany.myapp.MainActivity (server)'
I/WindowState(  332): WIN DEATH: Window{529a1e7c u0 com.mycompany.myapp/com.mycompany.myapp.MainActivity}
W/ActivityManager(  332): Exception thrown during pause
W/ActivityManager(  332): android.os.DeadObjectException
W/ActivityManager(  332): 	at android.os.BinderProxy.transact(Native Method)
W/ActivityManager(  332): 	at android.app.ApplicationThreadProxy.schedulePauseActivity(ApplicationThreadNative.java:635)
W/ActivityManager(  332): 	at com.android.server.am.ActivityStack.startPausingLocked(ActivityStack.java:990)
W/ActivityManager(  332): 	at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:3834)
W/ActivityManager(  332): 	at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:3766)
W/ActivityManager(  332): 	at com.android.server.am.ActivityManagerService.handleAppCrashLocked(ActivityManagerService.java:8344)
W/ActivityManager(  332): 	at com.android.server.am.ActivityManagerService.makeAppCrashingLocked(ActivityManagerService.java:8221)
W/ActivityManager(  332): 	at com.android.server.am.ActivityManagerService.crashApplication(ActivityManagerService.java:8900)
W/ActivityManager(  332): 	at com.android.server.am.ActivityManagerService.handleApplicationCrashInner(ActivityManagerService.java:8455)
W/ActivityManager(  332): 	at com.android.server.am.NativeCrashListener$NativeCrashReporter.run(NativeCrashListener.java:86)
I/ActivityManager(  332): Process com.mycompany.myapp (pid 9296) has died.

Working great on Android 4.4+ and iOS, however.

undefined is not an object (evaluating '_reactNativeFbads.InterstitialAdManager.showAd')

Hi, I just made a simple test in order to see how the interstitial works but I got this error.

screen shot 2016-11-23 at 4 36 12 pm

I ran this

react-native install react-native-fbads

and my code is this

import { InterstitialAdManager } from 'react-native-fbads'
InterstitialAdManager.showAd("my_ad_code")
.then(didClick => {console.log("click")})
.catch(error => {console.log("error")})

Any advice ?

Thanks

Android install fails

Hey,

I've followed your install steps AND fbsdk's one for Android (I have no issue with iOS). But each time I try to run it (either on device or emulator), I get the following error:

undefined is not an object (evaluating 'CTKNativeAdManager.init')

Do you guys have any idea why and how I can fix this ?
Thanks !

Module doesn't link for Android

Hi,

I have React-Native v41.
I downloaded the react-native-fbads with yarn and after that I did "react-native link".
It showed me that the iOS module was link but nothing about the Android module.

How I have to do? Have I to install other things than this to make it working?

When I try to use it on my code, I can't use ith undefined with this line of code :
import { NativeAdsManager } from 'react-native-fbads';
const adsManager = new NativeAdsManager('18025212...');

Sincerely,

Apple Mach-O Linker error building with FBAudienceNetwork.framework

Using React Native 0.37,

I am getting this error when I try to build with FBAudienceNetwork.framework

Undefined symbols for architecture x86_64:
  "_xmlFree", referenced from:
      lxml::xpath::object::string() in FBAudienceNetwork(FNFMediaPresentationDescription.o)
  "_xmlFreeDoc", referenced from:
      lxml::xml::xml(void const*, unsigned long, char const*, char const*, int) in FBAudienceNetwork(FNFMediaPresentationDescription.o)
  "_xmlLastError", referenced from:
      lxml::xml::xml(void const*, unsigned long, char const*, char const*, int) in FBAudienceNetwork(FNFMediaPresentationDescription.o)
  "_xmlReadMemory", referenced from:
      lxml::xml::xml(void const*, unsigned long, char const*, char const*, int) in FBAudienceNetwork(FNFMediaPresentationDescription.o)
  "_xmlXPathCastToBoolean", referenced from:
      +[FNFMediaPresentationDescription presentationDescriptionWithContentsOfXml:mpdUrl:segmentsFromEndToStartForLive:error:] in FBAudienceNetwork(FNFMediaPresentationDescription.o)
  "_xmlXPathCastToNumber", referenced from:
      +[FNFMediaPresentationDescription presentationDescriptionWithContentsOfXml:mpdUrl:segmentsFromEndToStartForLive:error:] in FBAudienceNetwork(FNFMediaPresentationDescription.o)
  "_xmlXPathCastToString", referenced from:
      lxml::xpath::object::string() in FBAudienceNetwork(FNFMediaPresentationDescription.o)
  "_xmlXPathCompile", referenced from:
      +[FNFMediaPresentationDescription presentationDescriptionWithContentsOfXml:mpdUrl:segmentsFromEndToStartForLive:error:] in FBAudienceNetwork(FNFMediaPresentationDescription.o)
  "_xmlXPathCompiledEval", referenced from:
      +[FNFMediaPresentationDescription presentationDescriptionWithContentsOfXml:mpdUrl:segmentsFromEndToStartForLive:error:] in FBAudienceNetwork(FNFMediaPresentationDescription.o)
  "_xmlXPathFreeContext", referenced from:
      +[FNFMediaPresentationDescription presentationDescriptionWithContentsOfXml:mpdUrl:segmentsFromEndToStartForLive:error:] in FBAudienceNetwork(FNFMediaPresentationDescription.o)
  "_xmlXPathFreeObject", referenced from:
      lxml::xpath::object::object(_xmlXPathObject*) in FBAudienceNetwork(FNFMediaPresentationDescription.o)
  "_xmlXPathNewContext", referenced from:
      +[FNFMediaPresentationDescription presentationDescriptionWithContentsOfXml:mpdUrl:segmentsFromEndToStartForLive:error:] in FBAudienceNetwork(FNFMediaPresentationDescription.o)
  "_xmlXPathRegisterNs", referenced from:
      +[FNFMediaPresentationDescription presentationDescriptionWithContentsOfXml:mpdUrl:segmentsFromEndToStartForLive:error:] in FBAudienceNetwork(FNFMediaPresentationDescription.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I was able to get the other frameworks to work though.

justify content is not working

render() {
return (
<BannerView style={{backgroundColor:'red' , flex:1,justifyContent:'center' , marginTop:20}}
placementId="566718123532432_613986802138897"
type="standard"
onClick={() => console.log('click')}
onError={(err) => console.log('error', err)}
/>
);
}

img_0062

Android cannot compile anymore

RN 0.44.1
react-native-fbads: "4.2.0"
react-native-fbsdk: "0.5.0"

My android app cannot compile anymore after I added this library.
However, my ios app works fine.

anyone encounter the same issue?

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Translation has been interrupted

* Try:
Run with --info or --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithDexForDebug'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:84)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228)
        at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77)
        at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
        at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:196)
        at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:193)
        at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:193)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102)
        at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
		at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
        at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: java.lang.RuntimeException: com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Translation has been interrupted
        at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:54)
        at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:158)
        at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:173)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:163)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76)
        ... 70 more
Caused by: com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Translation has been interrupted
        at com.android.build.gradle.internal.transforms.DexTransform.transform(DexTransform.java:443)
        at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:178)
        at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:174)
        at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:156)
        ... 77 more
Caused by: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Translation has been interrupted
        at com.android.builder.core.DexByteCodeConverter.dexInProcess(DexByteCodeConverter.java:179)
        at com.android.builder.core.DexByteCodeConverter.runDexer(DexByteCodeConverter.java:157)
        at com.android.builder.core.DexByteCodeConverter.convertByteCode(DexByteCodeConverter.java:146)
        at com.android.builder.core.AndroidBuilder.convertByteCode(AndroidBuilder.java:1386)
        at com.android.build.gradle.internal.transforms.DexTransform.transform(DexTransform.java:272)
        ... 80 more
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Translation has been interrupted
        at com.android.builder.core.DexByteCodeConverter.dexInProcess(DexByteCodeConverter.java:177)
        ... 84 more
Caused by: java.lang.RuntimeException: Translation has been interrupted
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:631)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:321)
        at com.android.dx.command.dexer.Main.run(Main.java:292)
        at com.android.builder.internal.compiler.DexWrapper.run(DexWrapper.java:54)
        at com.android.builder.core.DexByteCodeConverter.lambda$dexInProcess$0(DexByteCodeConverter.java:173)
        at com.android.builder.core.DexByteCodeConverter$$Lambda$189/1802977729.call(Unknown Source)
Caused by: java.lang.InterruptedException: Too many errors
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:623)
        ... 5 more


Can't seem to get test ads to show up in iOS simulator

I used a placementId from the FAN dashboard and am running on a simulator, I'm getting nothing.

          import { BannerView } from 'react-native-fbads';

          <BannerView
            placementId="my_placement_id"
            type="large"
            onClick={() => console.log('click')}
            onError={(err) => console.log('error', err)}
          />

Am using React Native 0.37 with the latest version of this library 4.0.0. When I try using 3.1.1, I get the error: "Element type is invalid: expected a string (for built-in components) or a class/function for composite components) but got: undefined

What am I missing?

Build Failed undefined symbol

getting build failed

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_FBAdSettings", referenced from:
      objc-class-ref in librn-fbads.a(CTKAdSettingsManager.o)
  "_OBJC_CLASS_$_FBAdView", referenced from:
      objc-class-ref in librn-fbads.a(CTKBannerView.o)
  "_OBJC_CLASS_$_FBInterstitialAd", referenced from:
      objc-class-ref in librn-fbads.a(CTKInterstitialAdManager.o)
  "_OBJC_CLASS_$_FBNativeAdsManager", referenced from:
      objc-class-ref in librn-fbads.a(CTKNativeAdManager.o)
  "_kFBAdSizeHeight250Rectangle", referenced from:
      -[CTKBannerView fbAdSizeForHeight:] in librn-fbads.a(CTKBannerView.o)
  "_kFBAdSizeHeight50Banner", referenced from:
      -[CTKBannerView fbAdSizeForHeight:] in librn-fbads.a(CTKBannerView.o)
  "_kFBAdSizeHeight90Banner", referenced from:
      -[CTKBannerView fbAdSizeForHeight:] in librn-fbads.a(CTKBannerView.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.