ReactNative FBSDK needs manual adding of code, in files where manual coding should not be needed

Hi,

In my react native app, I have used the FBSDK npm module.
This module requires some changes to “some files” where we do not need to code manually, in reality, but the facebook docs itself said to change the code manually.
See here -> https://developers.facebook.com/docs/react-native/configure-android-current/
Now I am confused how to we build the same with Bitrise, how to add these codes dynamically after “npm install” command.
My most of the apps has FBSDK, so need to get the answer asap.

Thanks,

Hello there!
You could do it if you make a “changeSomeFiles.js” file and code the changes with the fs node module, and after the npm install step, you add a script step in which you run it like “node changeSomeFiles.js” and it should do the trick.
Or you can manage to do this with a bash script as well.

Hey, Thank you for the reply.
Can you please let me know how can I pass the Bitbucket branch name or workflow name as a parameter to “changeSomeFiles.js”, so that I can make necessary changes based on the workflow or atleast bitbucket branch.

Any Idea ?

Hey the branch name is stored in the $BITRISE_GIT_BRANCH env variable.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.