4

I found this answer https://stackoverflow.com/a/41703745/1646117 but I am not able to make it work with React-native 0.40.

They changed the way how headers are imported and now "RCTHTTPRequestHandler.h" is not visible from user source code. Is there a way to make this work permanently? (we can do it with changing react-native code but the change goes away after adding new module).

Added images:

What I need to accomplish what i need

Here's the problem where is the problem

You can see that at the bottom of the build phases copy headers phase there is the RCTBridgeModule.h header and so no error when importing it. But there is not RCTHTTPRequestHandler.h header so my code cant import it.

Community
  • 1
  • 1
leizeQ
  • 795
  • 1
  • 7
  • 18
  • As I understand it's not a remote package. Why don't you just use the new headers? – binchik Feb 02 '17 at 10:48
  • What is a remote package (in this context)? I can't use the new header because my code doesn't see it. – leizeQ Feb 03 '17 at 07:41
  • Does this issue help you? https://github.com/facebook/react-native/issues/11721 – binchik Feb 03 '17 at 08:28
  • Nope. Their problem is importing headers that are included in the Copy Headers phase of React project. That is working for me without problems. My initial problem is that I need to override URLSession:didReceiveChallenge:completionHandler: on RCTHTTPRequestHandler which was successfully done with the answer I linked. But in RN 0.40 its not possible. I am looking for a new way to do it. – leizeQ Feb 03 '17 at 11:45
  • @leizeQ: did you find the solution? – Nam Vu Apr 19 '17 at 11:26
  • I used TrustKit and modified it to my needs – leizeQ Apr 19 '17 at 13:42

1 Answers1

1

Follow this but add: $(SRCROOT)/../node_modules/react-native/Libraries/Network as recursive type for visibility RCTHTTPRequestHandler.h.

Or you may add $(SRCROOT)/../node_modules/react-native/Libraries for visibility all files in subprojects.

Community
  • 1
  • 1
JagrDev
  • 107
  • 4