Проблемы с рекламой в фейсбуке sdk - PullRequest
1 голос
/ 10 июля 2019

Я заставляю реагировать на родную выставочную программу.Я хотел добавить рекламу FB в свое приложение.Я сделал все как в документах, но выдает ошибку:

"errorCode": 1203,
"errorMessage": "The SDK version in the ad request is no longer supported for new apps. Please upgrade to one of the latest versions of the SDK",

},

Как я могу загрузить последнюю версию SDK для рекламы fd ads?Я скачал SDK с этой страницы:

https://github.com/expo/expo/tree/master/packages/expo-ads-facebook

Я использую expo SDK 33. Пожалуйста, помогите мне.Мне это очень нужно

Код:

// page.js
import React from 'react';

import { View } from 'react-native';
import { createStackNavigator, createAppContainer } from 'react-navigation'; // Version can be specified in package.json
import * as FacebookAds from 'expo-ads-facebook';

import AdScreenFacebook from './AdScreenFacebook'

const adsManager = new FacebookAds.NativeAdsManager("2272791379702600_2272795453035526", 10);

class AdScreen extends React.Component {
  render () {
          return (
  <View>
  <AdScreenFacebook adsManager={adsManager} />

  <FacebookAds.BannerAd
      placementId="2272791379702600_2272803043034767"
      type="standard"
      onPress={() => console.log('click')}
      onError={error => console.log('error', error)}
    />
    </View>
          );
      }

 }


  export default createStackNavigator(
    {
      Main: {
        screen: AdScreen,
      },
      AdScreenFacebook: {
        screen: AdScreenFacebook,
      }
    },
    {
      initialRouteName: 'Main',
    }
  );
  
  // AdScreenFacebook.js
  
  import React from 'react';

import { StyleSheet, Text, View, Dimensions } from 'react-native';

import * as FacebookAds from 'expo-ads-facebook';
const { AdTriggerView, AdMediaView, AdIconView } = FacebookAds;


class AdScreenFacebook extends React.Component {
  render () {
          return (
            <View style={{  flexDirection: 'column',
    justifyContent: 'center',
    alignItems: 'center',}}>
            <View style={{ width:500}}>
                   <AdMediaView style={{ width: 160, height: 90 }}/>
                   <View style={{flexDirection: 'row'}}>
                   <AdIconView style={{ width: 50, height: 50 }}/>
                   <AdTriggerView>
                     <Text>{this.props.nativeAd.bodyText}</Text>
                       <Text>{this.props.nativeAd.callToActionText}</Text>
                   </AdTriggerView>
                 </View>
                  </View>
                    </View>
    );
      }

 }


export default FacebookAds.withNativeAd(AdScreenFacebook);
...