简体   繁体   中英

React Native ads (Adcolony) - Expo

I've used this npm library which is a react native bridge for adcolony ads SDK , i was supposed to display advertise in my application .

When i imported and used mentioned library in my react native application i got following error:

在此处输入图片说明

This is how i use the adcolony SDK in my react-native app:

  .
  .
  .

  line 6  : import RNAdColony from 'react-native-ad-colony';
  .
  .
  .

  line 187: RNAdColony.setUser("456456456456");
  line 188: RNAdColony.showAdReward("vz0533ae6a620249ef91");

How can i solve this problem?

I've recently found the answer of my question :

The above error occurs because linking between SDK and React-native project was not established.

This error occurs because Adcolony.setUser() method was return an undefined and React-native didn't get what happened; eventually an unhandled promise error have been shown .

After a lot of searches, i was understand that when you using Expo to develop your React-native project , Expo needs Expokit which is a library that allows Expo to run React-native commands such as "react-native link" ; in other words, Expokit is an extra library for custom SDK implementation.

What is Expokit?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM