Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an installation option without CocoaPods #54

Open
Kureev opened this issue Mar 20, 2017 · 9 comments
Open

Provide an installation option without CocoaPods #54

Kureev opened this issue Mar 20, 2017 · 9 comments

Comments

@Kureev
Copy link

Kureev commented Mar 20, 2017

Dear authors,

Currently, there is only one way how you can add this project to iOS app (using CocoaPods). As a JavaScript / React Native developer, I'd like to be able to install this awesome library using react-native install or link it by using react-native link. Although it's not hard to do, the code won't work with a standard react-native init app due to the current way it imports React (using import React in Swift files).

I managed to make it work without these imports (by adding native-navigation library directly to the project), but I consider this way pretty hackish as I have to remove these imports by hand. I'd like to find a way how we can distribute a Cocoa pod using CocoaPods and npm module using the same codebase. The best thing I can think of is a pre-publish hook that cuts off imports before publishing (tmp dir -> s/import React//g -> publish files from tmp dir -> rm tmp dir).

What do you think?

@Kureev Kureev changed the title Provide an option without CocoaPods Provide an installation option without CocoaPods Mar 20, 2017
@lelandrichardson
Copy link
Collaborator

Hey, thanks for filing an issue. I'd like us to make Native Navigation work without CocoaPods.

The problem is not cocoapods but rather the fact that the swift library (native navigation) has a transitive dependency on React, which we also want to include in the app as a statically linked binary, which for the most part is incompatible with swift.

I don't think removing the imports and then treating the library as application code is the right approach though. I will try and rope in some other people that understand this better and see if they can help and what they think we should do.

@Kureev
Copy link
Author

Kureev commented Mar 20, 2017

Thanks for your feedback!

Yeah, I completely understand your concerns. This is just one of the approaches we can take there, so I'm completely fine with any proposed alternative if result will be the same.

In the meantime, I'll fill the gap by forking your library and implementing proposed solution. Once it'll be solved in the master, I'll delete my fork.

Please, let me know if I can help solving this.

@nihgwu
Copy link

nihgwu commented Mar 21, 2017

What about Carthage support? I only use Carthage in my development

@Kureev
Copy link
Author

Kureev commented Mar 21, 2017

@nihgwu can we have a separate thread for Carthage support? I'd like to keep this thread as focused as possible (otherwise initial subject will be lost).

@braco
Copy link

braco commented Apr 5, 2017

@Kureev - could you write out how you got the install working, specifically? Would be helpful to me, I don't use CocoaPods.

@Kureev
Copy link
Author

Kureev commented Apr 6, 2017

@braco sure. I wrote a short blogpost about it, but not sure if I should publish it. Here you can see the draft: https://medium.com/@kureevalexey/how-to-use-airbnbs-native-navigation-without-cocoapods-aa958554beff

@braco
Copy link

braco commented Apr 6, 2017

@Kureev: thank you! I say publish it, a hacky solution beats no solution.

@mgriepentrog
Copy link
Contributor

With upcoming support for Swift static libraries in Xcode 9, it seems like it should be possible to get something working with react-native link.

@MarkMolina
Copy link

Is there anyone that managed to do this with react-native link?

jahglow pushed a commit to jahglow/native-navigation that referenced this issue Mar 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants