为什么AppEventsLogger.logEvent未定义?

时间:2017-02-09 07:05:11

标签: react-native react-native-fbsdk

  • react-native:0.40
  • react-native-fbsdk:0.5

我想在我的React Native项目中使用react-native-fbsdk记录事件,我通过该库的指令完成所有操作。但是当我尝试在iOS模拟器上启动它时出现错误:

  

undefined不是对象(评估'AppEventsLogger.logEvent')

2 个答案:

答案 0 :(得分:1)

这似乎是react-native-fbsdk中的问题。参考以下链接

AppEventsLogger.logEvent

答案 1 :(得分:0)

就我而言,react-native run-android有效。链接后也运行 @Test void test() { try { String filePath = "C:/Users/Administrator/Desktop/backupv2/imageMgmt/asdf/"; File directory = new File(filePath); if (!directory.exists()) { Files.createDirectories(Paths.get(filePath)); directory.mkdir(); } String val = "space"; File imageValue = new File("C:/Users/Administrator/Desktop/backupv2/" + val + ".gif"); FileInputStream imageInFile = new FileInputStream(imageValue); byte[] imageByte= new byte[(int) (imageValue.length())]; imageInFile.read(imageByte); String base64String = Base64.getEncoder().encodeToString(imageByte); //Path destinationFile = Paths.get("https://172.20.188.63:8553/m/" + val + ".gif"); Path destinationFile = Paths.get(filePath + val + ".gif"); byte[] decoded = Base64.getDecoder().decode(base64String); System.out.println("Path: " + destinationFile.toString()); Files.write(destinationFile, decoded); System.out.println("Upload success!"); }catch(Exception e) { } }

希望这会有所帮助。