0

Question on how to require cocoapods in JavaScript using Hyperloop: what is the most reliable way to know the string that is supposed to be passed to the require statement for a cocoapod? For example the Ti docs use pod 'JBChartView' in their Podfile and subsequently call require('JBChartView/JBBarChartView'). How is it determined that 'JBChartView/JBBarChartView' was the correct string to use in the require statement?

The cocoapod I'm trying to do this with is https://github.com/janrain/jump.ios.

I've tried the following require statement path combinations to no avail:

  • Janrain
  • Janrain/JRConnectionManager
  • Janrain/JRConnectionManager/JRConnectionManager
  • Janrain/JREngage
  • Janrain/JREngage/JRInfoBar
  • Janrain/JREngage/JRNativeAuth
  • Janrain/JREngage/Classes/JRInfoBar
  • Janrain/JREngage/Classes/JRNativeAuth
  • Janrain/Janrain/JRConnectionManager
  • Janrain/Janrain/JRConnectionManager/JRConnectionManager
  • Janrain/Janrain/JREngage
  • Janrain/Janrain/JREngage/JRInfoBar
  • Janrain/Janrain/JREngage/JRNativeAuth
  • Janrain/Janrain/JREngage/Classes/JRInfoBar
  • Janrain/Janrain/JREngage/Classes/JRNativeAuth

This is the error I get when attempting require any of those paths: Hyperloop require statement error

1 Answers1

1

You structure your require-statement with the framework + class name. So if your framework is called Janrain and your class is called JRConnectionManager, you require it with require("Janrain/JRConnectionManager"). And if you need to require constants/property, you do that by require-ing the framework and select the constant/property like this: require("UIKit").UIUserInterfaceIdiomPhone.

However, your error looks like it cannot find the class itself, so you may have problems in your Podfile. Take a look at the hyperloop-examples application regarding that. Good luck!

Hans Knöchel
  • 11,422
  • 8
  • 28
  • 49