Skip to content

Commit

Permalink
Copy over proposed changes from the old repo (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
hramos authored Dec 8, 2017
1 parent aeb7ea5 commit ae1254e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
4 changes: 4 additions & 0 deletions docs/improvingux.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ Android API 21+ uses the material design ripple to provide user with feedback wh

[Try it on your phone](https://snack.expo.io/SJywqe3rZ)

## Screen orientation lock

Unless supporting both, it is considered good practice to lock the screen orientation to either portrait or landscape. On iOS, in the General tab and Deployment Info section of Xcode enable the Device Orientation you want to support (ensure you have selected iPhone from the Devices menu when making the changes). For Android, open the AndroidManifest.xml file and within the activity element add 'android:screenOrientation=”portrait”' to lock to portrait or 'android:screenOrientation=”landscape”' to lock to landscape.

# Learn more

[Material Design](https://material.io/) and [Human Interface Guidelines](https://developer.apple.com/ios/human-interface-guidelines/overview/design-principles/) are great resources for learning more about designing for mobile platforms.
4 changes: 2 additions & 2 deletions docs/integration-with-existing-apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -548,16 +548,16 @@ dependencies {

> If you want to ensure that you are always using a specific React Native version in your native build, replace `+` with an actual React Native version you've downloaded from `npm`.
Add an entry for the local React Native maven directory to `build.gradle`. Be sure to add it to the "allprojects" block:
Add an entry for the local React Native maven directory to `build.gradle`. Be sure to add it to the "allprojects" block, above other maven repositories:

```
allprojects {
repositories {
...
maven {
// All of React Native (JS, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
...
}
...
}
Expand Down
33 changes: 32 additions & 1 deletion docs/running-on-device.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,38 @@ To configure your app to be built using the `Release` scheme, go to **Product**

![](/react-native/docs/assets/ConfigureReleaseScheme.png)

### 3. Build app for release
### 3. Configure app to use static bundle

During the development process, React Native has loaded your JavaScript code dynamically at runtime. For a production build, you want to pre-package the JavaScript bundle and distribute it inside your application. Doing this requires a code change in your code so that it knows to load the static bundle.

In `AppDelegate.m`, change the default `jsCodeLocation` to point to the static bundle that is built in Release.

```objc
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
```
This will now reference the `main.jsbundle` resource file that is created during the `Bundle React Native code and images` Build Phase in Xcode.
> Note: The static bundle is built every time you target a physical device, even in Debug. If you want to save time, turn off bundle generation in Debug by adding the following to your shell script in the Xcode Build Phase `Bundle React Native code and images`:
```shell
if [ "${CONFIGURATION}" == "Debug" ]; then
export SKIP_BUNDLING=true
fi
```

#### Pro Tip

As your App Bundle grows in size, you may start to see a white screen flash between your splash screen and the display of your root application view. If this is the case, you can add the following code to `AppDelegate.m` in order to keep your splash screen displayed during the transition.

```objc
// Place this code after "[self.window makeKeyAndVisible]" and before "return YES;"
UIView* launchScreenView = [[[NSBundle mainBundle] loadNibNamed:@"LaunchScreen" owner:self options:nil] objectAtIndex:0];
launchScreenView.frame = self.window.bounds;
rootView.loadingView = launchScreenView;
```
### 4. Build app for release
You can now build your app for release by tapping `⌘B` or selecting **Product** → **Build** from the menu bar. Once built for release, you'll be able to distribute the app to beta testers and submit the app to the App Store.
Expand Down

0 comments on commit ae1254e

Please sign in to comment.