kraffslol / react-native-braintree-xplat

Cross-platform Braintree module for React Native
MIT License
81 stars 121 forks source link

Support RN 0.60+ autolinking #118

Open WoodyWoodsta opened 5 years ago

WoodyWoodsta commented 5 years ago

Installing this module and using it results in the error indicating that the module does not support the new autolinking.

https://facebook.github.io/react-native/blog/2019/07/03/version-60#native-modules-are-now-autolinked

sam17896 commented 5 years ago

@WoodyWoodsta have you found any work around yet for this problem, i am getting error 'React/RCTBridgeModule.h' file not found

WoodyWoodsta commented 5 years ago

That sounds unrelated.

cubabit commented 5 years ago

It is kind of related, it is what happens if you manually link then try to build.

wkoutre commented 5 years ago

@sam17896 any luck figuring this out?

wkoutre commented 5 years ago

FWIW I figured this out.

I have a fork working with autolinking.

In case you want to do it on your own, the TLDR is:

  s.dependency 'Braintree', '4.11.0'
  s.dependency 'BraintreeDropIn'
  s.dependency 'Braintree/PayPal'
  s.dependency 'Braintree/Apple-Pay', '4.11.0'
  s.dependency 'Braintree/3D-Secure'
  s.dependency 'Braintree/DataCollector'

Checkout the podspec in the fork above for an example if you're unsure. Good learning experience!

alexkendall commented 3 years ago

@sam17896 Where you able to find a solution to that issue?

alexkendall commented 3 years ago

@wkoutre Your fork isn't currently compiling for me. I'm receiving deprecation errors for some of the methods.

wkoutre commented 3 years ago

@alexkendall If you're able to share some logs, I can check it out. Currently using my fork in production without issues.

alexkendall commented 3 years ago

@wkoutre Thanks for taking a look. Currently I'm receiving the following errors:

.../ios/Pods/Braintree/BraintreeUI/Drop-In/BTDropInErrorAlert.m:79:1: Implementing deprecated method

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIAlertView.h:71:1: Method 'alertView:clickedButtonAtIndex:' declared here

.../ios/Pods/BraintreeDropIn/BraintreeDropIn/BTDropInController.m:199:176: 'bottomLayoutGuide' is deprecated: first deprecated in iOS 11.0 - Use view.safeAreaLayoutGuide.bottomAnchor instead of bottomLayoutGuide.topAnchor

.../ios/Pods/BraintreeDropIn/BraintreeDropIn/BTDropInController.m:324:68: 'topLayoutGuide' is deprecated: first deprecated in iOS 11.0 - Use view.safeAreaLayoutGuide.topAnchor instead of topLayoutGuide.bottomAnchor

XCode Version 12.4

wkoutre commented 3 years ago

Hm, it seems like (for some reason) warnings are being treated as errors; I'd look into that (check your compiler flags)

alexkendall commented 3 years ago

@wkoutre My compiler flags have "Treat Warnings as Errors" set to "No". Unsure how to work around this. What version of react-native and Xcode are you currently using?

wkoutre commented 3 years ago

Hey, sorry @alexkendall -- missed this response yesterday.

I'm on react-native@0.63.4 and Xcode 12.4 using new build system (not legacy).

Is it possible for you to point me to a repo replicating the issue you're having?