Skip to content
This repository has been archived by the owner on Jul 18, 2020. It is now read-only.

Add support to include library using .xcodeproj without CocoaPods #4

Closed
hzalaz opened this issue Nov 18, 2015 · 14 comments
Closed

Add support to include library using .xcodeproj without CocoaPods #4

hzalaz opened this issue Nov 18, 2015 · 14 comments

Comments

@hzalaz
Copy link
Member

hzalaz commented Nov 18, 2015

Need to have a Lock as a static library and all resources bundle (with images and xib files)

@cancan101
Copy link

Any way we can prioritize this approach?

As of now even if we get the CP approach to work, it looks like removing the various RN projects breaks functionality in XCode.

@cancan101
Copy link

@hzalaz What I did have success with is using cocoapods to install the dependencies of the Lock but not the RN code itself. In other words, my Podfile has:

pod 'Lock'
pod 'Lock/TouchID'
pod 'Lock/SMS'
pod 'Lock/Email'

Right now I just add the m/h files in this repos manually to my project. Theoretically those should be addable through another project, I would imagine?
image

That way I don't need to tinker with how React in included.

@hzalaz
Copy link
Member Author

hzalaz commented Dec 14, 2015

Yes, but the ideal will be with the Lock static lib instead of using CocoaPods to build it.
It's a workaround but you'll probably need to use CocoaPods for all your native dependencies otherwise you might get duplicated symbols, e.g. if an react-native third party lib includes a dependency already included by cocoapods. Might not happen ofter but I'd rather avoid those cases

@cancan101
Copy link

Agreed on not ideal and I would prefer to not use CP at all here. That being said I am not too worried about conflict here as the only items pulled in through CP are Auth0.

@hzalaz
Copy link
Member Author

hzalaz commented Dec 14, 2015

Yes, but Auth0 has a couple of dependencies, e.g. Facebook SDK in Lock-Facebook

@carbureted
Copy link

Any solution that doesn't require pulling out the react subprojects would be very very very strongly preferable - there are other useful react-native libraries that seem to expect react-native components to be included in the traditional way, and I expect that pulling them out is going to lead to major maintenance headaches down the road (most immediately on major react-native updates).

@hzalaz
Copy link
Member Author

hzalaz commented Jan 22, 2016

@carbureted short of rewriting the entire objc Lock library for react-native, which is not in our plans right now, I can't come up with a perfect solution for this since react native provides no support for this kind of libs that have a native dependency and most libraries are very simple (just one or two objc files with no dependencies)
Also the way React core is included in the Xcode project is the least recommended way to include a native library in any app so it makes our work a little harder.

That being said, I have almost finished a compromise solution to this issue at the cost of losing the native integration like using facebook sdk to login.
Lock will be added using and .xcodeproj that includes the bridge code between Lock.iOS-RN and the lock itself already compiled as a static library (with all the basic dependencies bundled there).
So the flow to include it will be similar of what is the "recommended" way in RN now, and let's hope it doesn't change soon :). I'll post it here when its done (my goal is end of february)

@cancan101
Copy link

This worked pretty well for me: #4 (comment)

@hzalaz
Copy link
Member Author

hzalaz commented Jan 22, 2016

@cancan101 yes, that will be our suggestion if you really want native integrations. I have to test that setup when you also include fb sdk as a rn dependency

@carbureted
Copy link

@cancan101 I'm pretty new to ios/xcode development - maybe there's a basic step I missed, but just dragging in the files as depicted gives me import errors. Did you need to modify any code?

@hzalaz I don't need anything other than the most basic email/password authentication, so the solution you mentioned sounds good to me.

@podviaznikov
Copy link

@cancan101 can you please provide ore information where do you put these files from the screenshot. I never worked with XCode before and can't understand where should I copy those files

@kennu
Copy link

kennu commented Mar 12, 2016

I've been spending hours trying to get this to work, without success, very frustrating. I wish Auth0 could provide a solution that would just work out-of-the-box, together with all other React Native libraries.

@tal952
Copy link

tal952 commented Mar 15, 2016

+1

@hzalaz
Copy link
Member Author

hzalaz commented Apr 5, 2016

Closing this, the module react-native-lock provides a .xcodeproj file but cocoapods is still needed to fetch native dependencies. However if using rpm, most of the heavy work is done automatically.

@hzalaz hzalaz closed this as completed Apr 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants