Improve CodePush client SDK setup steps - #142
Conversation
|
|
||
| ## Configuring CodePush for React Native apps | ||
|
|
||
| CodePush for React Native requires installing the SDK and then setting up CodePush for both the iOS and the Android modules. |
There was a problem hiding this comment.
This sentence has no practical information: CodePush exists only for React Native, and the setup is explained below.
24582da to
bf5ab30
Compare
| --- | ||
| title: "Configuring your app for CodePush" | ||
| description: "Install the CodePush SDK and add the deployment keys and the CodePush Server URL to the app configuration. The process is different for React Native and Expo apps." | ||
| title: "CodePush client SDK setup" |
There was a problem hiding this comment.
I wanted to emphasize that it's the client-side setup guide
| 1. Set up CodePush for iOS. You can find the most important instructions here: [iOS setup](#ios-setup). | ||
| 1. Set up the CodePush iOS SDK in your project: [iOS setup](#ios-setup). | ||
|
|
||
| Read more in the GitHub repository of the SDK: [iOS](https://github.com/bitrise-io/react-native-code-push/blob/master/docs/setup-ios.md). |
There was a problem hiding this comment.
Two issues with this:
- It links to our forked repo for some reason (while the rest of the doc still links to the
codepush-nextproject) - We shouldn't tell users to go read some other docs elsewhere, we should do a good job of explaining things here. I reviewed those iOS and Android docs. They are more verbose and have more background information, but some of them are irrelevant when using Bitrise as the CodePush server, so I rather moved the really important information over to this page.
| ### iOS setup | ||
|
|
||
| 1. Make sure the bundle identifier matches the bundle identifier you used when [creating the app on Bitrise](/en/release-management/getting-started-with-release-management/adding-a-new-app-to-release-management). You can use `react-native-rename` to rename your app with a custom bundle identifier: [react-native-rename](https://www.npmjs.com/package/react-native-rename). | ||
| 1. In `ios/Podfile`, look for the line `platform :ios`, `min_ios_version_supported`. Change it to `platform :ios, 15.5`. |
There was a problem hiding this comment.
This is an optional step and is just noise for those projects that define >= 15.5 as the min deployment target, so I moved it to the end of this list and marked as optional.
| 1. Update `ios/<projectname>/Info.plist` with your Bitrise project credentials to let the CodePush runtime know which deployment it should query for updates against. | ||
|
|
||
| ```xml | ||
| #The CodePush deployment key |
There was a problem hiding this comment.
# comments are invalid plist syntax. And we explain these anyway.
| <string>https://<workspace-slug>.codepush.bitrise.io</string> | ||
| ``` | ||
|
|
||
| **Deployment key**: Copy value from Bitrise CodePush deployments screen. You get the deployment key when creating the [CodePush deployment on Bitrise](/en/release-management/codepush/creating-a-codepush-deployment). |
There was a problem hiding this comment.
I wanted to emphasize that the deployment key is something found on the web UI (but probably available through the API and CLI as well, right?)
| apply from: "../../node_modules/@code-push-next/react-native-code-push/android/codepush.gradle" | ||
| ... | ||
| ``` | ||
| 1. Update `android/app/build.gradle android.defaultConfig` to setup `versionCode` and `versionName`: |
There was a problem hiding this comment.
I have no idea why this was added. These env vars are nowhere to be found in a default React Native project or in the client SDK. It's also something that all projects set up in different ways, so I don't think we want to mention this.
|
|
||
| :::important[PackageList] | ||
|
|
||
| PackageList must be instantiated only once in the application's lifetime. |
There was a problem hiding this comment.
This is already defined correctly in a freshly generated React Native project, I don't think this callout has any value in this doc.
| import com.microsoft.codepush.react.CodePush | ||
|
|
||
| class MainApplication : Application(), ReactApplication { | ||
| override val reactNativeHost: ReactNativeHost = |
There was a problem hiding this comment.
This is the legacy, pre-New-Architecture way of loading the main bundle. Since New Architecture is the default now, I took the liberty to only document this way and not mention the legacy thing at all.
| } | ||
| } | ||
| ``` | ||
| 1. In `android/app/src/main/res/value/strings.xml`, add the CodePush deployment key and the CodePush Server URL. |
There was a problem hiding this comment.
Path was incorrect, there is no value folder, it's values.
a61d567 to
406007c
Compare
- Fix dead intro anchor (non-Expo setup) and use one name for the section
- Rewrite intro sentence; remove unused Tabs/TabItem/GlossTerm imports
- Add legacy RN pointer to the SDK fork's setup guides
- Tighten the DEBUG-macro paragraph
- "Bitrise project credentials" -> deployment key and server URL (glossary)
- Replace code-comment emojis with the SDK docs' numbered comment style
- Unbold non-UI phrases; missing articles; quote Podfile version ('15.5')
Agreed with Oliver in the Slack thread. Expo section untouched (see PR #146).
ilanazholobovsky
left a comment
There was a problem hiding this comment.
My edits are on the branch (list's in the commit message)
Context: the existing doc page was written for an older version, so there are now inaccurate instructions. As well as missing ones that I think makes sense to include.
Status: reviewed by @BirmacherAkos and the RM team.