braintree / braintree-ios-drop-in

Braintree Drop-in for iOS
https://developers.braintreepayments.com
MIT License
98 stars 77 forks source link

Xcode can't file PayPalDataCollector-Swift.h #365

Closed RayKay91 closed 2 years ago

RayKay91 commented 2 years ago

Integration Details (please complete the following information):

Describe the bug Description of what the bug is. Please include as many details as possible.

To Reproduce Steps to reproduce the behavior:

  1. Try to build project
  2. Build fails because it cannot find file: PayPalDataCollector-Swift.h (Error occurs in BTDropInResult.m)

Screenshots

Screenshot 2022-02-02 at 12 05 21

Although I am using the Pod in a React Native app I don't believe this is causing any problems. Xcode cannot find the file pictured.

I can build and the drop in works fine if I comment out the code that causes the issue.

jaxdesmarais commented 2 years ago

Hello @RayKay91 -

I've tested this via both the demo app in this repo as well as a standalone demo app and am unable to replicate this error. The header's name is generated from our PayPalDataCollector module name, followed by "-Swift.h" when it is exposed to Objective-C (you can read more about this process here).

Are you able to provide a simple sample project where we can replicate this error? From there, we would be happy to take a look as this error appears to be independent to your configuration.

RayKay91 commented 2 years ago

Sure: https://github.com/RayKay91/rn-braintree-demo

open ios/bttest.xcworkspace in Xcode, or run xed ios in the terminal from project root. You'll see the issue if you open up the Pods/BraintreeDropIn folder then the BTDropInResult.m file

jaxdesmarais commented 2 years ago

@RayKay91 - thanks for sending over that sample project. I've also been able to reproduce this locally with a react native application. It is worth noting, that we do not officially support react native, so we cannot guarantee a timeline/fix for this issue. As a temporary solution, using version 9.1.0 of the Drop-in resolved the issue for me locally. I will let you know when we have an update on the original issue.

RayKay91 commented 2 years ago

@jaxdesmarais Awesome! Thanks for the help!

I saw one of the older issues mentioning that it could be an option in the future to support React Native. I'd like to add my vote to that if you could relay it to your team 😄

Thanks again! 🚀

jaxdesmarais commented 2 years ago

Hello @RayKay91 - thanks for your patience as we had some time this week to look into this. I've opened up a PR #368 with and updated import statement for this. I've tested this in a local react native app and am no longer running into the warning that you were experiencing. Would you mind pulling this branch down on your end and letting me know if it resolves the issue on your end? With cocoapods you should be able to point to the branch by specifying the following in your podfile:

pod 'BraintreeDropIn', :git => 'https://github.com/braintree/braintree-ios-drop-in.git', :branch => 'cocoapods-fix-for-react-native'
RayKay91 commented 2 years ago

Hey so sorry @jaxdesmarais have been super busy.

I can confirm that it resolves the issue and everything seems to be working fine. Thanks again 😄 🥇