dpa99c / react-native-launch-navigator

A React Native module for launching today's most popular navigation/ride apps to navigate to a destination.
143 stars 34 forks source link

Remove automatic linking on install/uninstall hooks #2

Closed jariwalabhavesh closed 5 years ago

jariwalabhavesh commented 5 years ago

I'm submitting a ... (check one with "x"):

Bug report

Current behavior: react-native-launch-navigation is an awesome library and it is linking itself on npm install that is great as well (That's awesome work to get raid of manual linking). But I am facing some real-world development issue.

  1. Generally while working on react-native, developers used to commit native library linking changes to the repo so the other developer need not worry about linking already install libraries. (I used to follow it because every time doing a react-native link, it's risky, In some case, it's breaking the application and also some library needs manual steps for linking, either in android or ios due to some constraint)

  2. Most important when we are using auto build servers which build a react-native app and create release builds. This server generally taking a pull of application and then do npm install then build it. here it will break it because we have already linked changes in file and react-native-launch-navigator will add one more time linking changes and it will appear twice in native files.

It will break app by providing error I had attached screenshot.

screenshot_1537509776

Expected behavior: It should work on a react-native link(not automatically on npm install) so it will fix the problem.

This what I thought. What you say let me know...

dpa99c commented 5 years ago

It should be possible to enhance the auto-linking scripts to first check if the project has already been linked before trying to link again. Same with unlinking. I'll have a go at this when I get a minute.

jariwalabhavesh commented 5 years ago

@dpa99c : Awesome Idea 👍

dpa99c commented 5 years ago

This should be resolved in v1.0.2 which checks if module is already linked before attempting linking/unlinking.

jariwalabhavesh commented 5 years ago

@dpa99c : Awesome thank you

GulinSS commented 5 years ago

@dpa99c can we add a way how to disable automatic linking? Something like https://stackoverflow.com/a/50402065? I mean if some environment variable is present do not linking... I need it for a reason.