追記
code push が microsoft app center に統合されるっぽいです。2018年9月以降使えなくなる(導入方法が変わる)可能性があります。
We are committed to maintaining the CodePush CLI through September 2018. You are free to continue using it until then, but all features except for releasing and viewing metrics will be disabled on March 31st, 2018.
このページについて
code push 設定を毎回わすれるので備忘録
公式Docs
iOS
https://github.com/Microsoft/react-native-code-push/blob/master/docs/setup-ios.md
やったこと
※code-push-cliとアカウント登録は済の前提
-
code-push でアプリの設定
code-push app add MY_APP_NAME ios react-native
出てきたdeployment keyをメモしておく -
ライブラリのインストール
npm install --save react-native-code-push
react-native link react-native-code-push
※ 追記: 現在react-native link のみだとCodepush.h not found になってしまうので、マニュアルで確認必要
- AppDelegate.mの設定
#import <CodePush/CodePush.h>
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
を下に入れ替える
jsCodeLocation = [CodePush bundleURL];
- Staging Schemaの作成
https://github.com/Microsoft/react-native-code-push/blob/master/docs/multi-deployment-testing-ios.md
Go to Build Location -> Per-configuration Build Products Path -> Staging and change Staging value from $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) to $(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME)
-
BuildSettingに環境毎のkeyを追加
Click the + button on the toolbar and select Add User-Defined Setting
完了!