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

Add react-native@0.60 and above support #1735

Merged
merged 25 commits into from
Dec 6, 2019

Conversation

alexandergoncharov-zz
Copy link
Contributor

@alexandergoncharov-zz alexandergoncharov-zz commented Dec 2, 2019

  • Add react-native.config.js
  • Update docs for setup new react-native versions
  • Continue keeping rnpm section in package.json for back-compatibility with React Native version < 0.59

@RodolfoGS
Copy link

What is the reason to use react-native.config.js? I'm not using that and works.

@joseph-d-p
Copy link

joseph-d-p commented Dec 3, 2019

@RodolfoGS it is used for migration from rnpm. RNPM is deprecated.

@joseph-d-p
Copy link

joseph-d-p commented Dec 3, 2019

@alexandergoncharov link hooks not anymore needed? Referenced the PRs related to this.

@builtbyproxy
Copy link

😍 @alexandergoncharov thanks for this, did you miss #1645
The docs are amazing! Any preference or input on the different configs?

@MatthewPattell
Copy link

MatthewPattell commented Dec 3, 2019

@alexandergoncharov how to use configuration with public key (fourth argument)?

On RN 0.59, it looks like this:

packages.add(new CodePush(BuildConfig.CODEPUSH_KEY_ANDROID, getApplicationContext(), isDebug(), R.string.CODEPUSH_PUBLIC_KEY));

@giacomocerquone
Copy link

giacomocerquone commented Dec 3, 2019

@MatthewPattell please, this is a PR! If you need help for something open an Issue.

PS: when you execute react-native link react-native-code-push it adds that line for you automatically asking you for the deployment key. But I do always advice to set the key in the js code. For more info see this article of mine :) https://giacomocerquone.com/blog/microsoft-codepush-integration-in-react-native-0.60

@giacomocerquone
Copy link

@alexandergoncharov hi, thanks for the work you're doing.
One quick question, considering that putting the deployment key in the native side is a facultative step, would you consider adding in the new docs a simple reminder of the possibility to put it in the js side of things (inside the codepush HoC)

@MatthewPattell
Copy link

@MatthewPattell please, this is a PR! If you need help for something open an Issue.

PS: when you execute react-native link react-native-code-push it adds that line for you automatically asking you for the deployment key. But I do always advice to set the key in the js code. For more info see this article of mine :) https://giacomocerquone.com/blog/microsoft-codepush-integration-in-react-native-0.60

Look carefully at the question! I asked about the public key, not deployment

@zanechua
Copy link

zanechua commented Dec 4, 2019

Does this PR work with multi-deployment? From what I am looking at the moment with the code changes. It doesn't seem to support multi deployment for android or am i mistaken?

The following docs changed that I requested a month and a half back at MicrosoftDocs/appcenter-docs#767 does resolve this though.

@alexandergoncharov-zz
Copy link
Contributor Author

Hi @zanechua ,
Thanks for this comment. Good catch!

Your approach is really good. Could you please create PR to current branch with your changes about multi-testing deployment? It will be cool to have this changes in current PR.

@alexandergoncharov-zz
Copy link
Contributor Author

Hi @joseph-d-p,

Unfortunatelly hooks doesn't work anymore and users have to change some part of code manually.
Here is more info: react-native-community/cli#429
Fortunately, some steps already will be done by autolinker.

@zanechua
Copy link

zanechua commented Dec 5, 2019

@alexandergoncharov Created the pull request to the migrate-to-autolink branch with the multi-deployment docs change for android.

#1738

@alexandergoncharov-zz alexandergoncharov-zz changed the title Add supporting react-native@0.60 and above Add support react-native@0.60 and above Dec 6, 2019
@alexandergoncharov-zz
Copy link
Contributor Author

alexandergoncharov-zz commented Dec 6, 2019

Hi @MatthewPattell ,

Good catch! Thanks!
Since it isn't possible to use a custom constructor with autolinker, we will change the constructor logic by automatically getting the public key from the strings and enabling code signing. The same situation with serverUrl field. To do this we will open separate PR.

@alexandergoncharov-zz alexandergoncharov-zz changed the title Add support react-native@0.60 and above Add react-native@0.60 and above support Dec 6, 2019
@alexandergoncharov-zz
Copy link
Contributor Author

Hi @giacomocerquone,

Thanks for this suggestion!
Added this note in Android and Ios setup docs.

@alexandergoncharov-zz alexandergoncharov-zz merged commit 0dfad8d into master Dec 6, 2019
@JeremyBradshaw7
Copy link

JeremyBradshaw7 commented Dec 6, 2019

I'm still confused about the Android setup for RN 0.61. Is it enough to follow ONLY the section:
Plugin Installation and Configuration for React Native 0.60 version and above

Or do you ALSO have to do the lower sections:
Plugin Configuration (Android)
For React Native >= v0.29

and
Code Signing setup
?

@builtbyproxy
Copy link

@alexandergoncharov
This is huge thanks a lot!!
Could you please ensure it is also published to NPM: https://www.npmjs.com/package/react-native-code-push

@alexandergoncharov-zz alexandergoncharov-zz deleted the migrate-to-autolink branch December 9, 2019 07:14
@alexandergoncharov-zz
Copy link
Contributor Author

alexandergoncharov-zz commented Dec 9, 2019

Hi @builtbyproxy ,

Thank you!
We will publish new version to npm as soon as we fix issues with custom variables(publicKey and serverUrl).

@alexandergoncharov-zz
Copy link
Contributor Author

Hi @JeremyBradshaw7,

Yeah, Plugin Installation and Configuration for React Native 0.60 version and above is enough for setup CodePush for new react-native version. Code Signing Setup is optional. But I got your confusing. We prepared new PR for adding more context about react-native versions in titles.
#1739
Could you please review it?

@builtbyproxy
Copy link

Do you need any help/testing from us around the custom variables?
Thanks for that documentation clarification for <= 0.59 RN

@alexandergoncharov-zz
Copy link
Contributor Author

@builtbyproxy , Yeah, we just opened new PR with getting custom properties from string resources: #1740
It would be great if you review and test it.
Please feel free to ask any questions.

Thanks for help!

sourabhdebnath pushed a commit to scripbox/react-native-code-push that referenced this pull request May 2, 2022
* Add react-native.config.js file

* Updated docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.