LoginSignup
0
3

More than 5 years have passed since last update.

react-native で code push を設定する(iOS) => AppCenterに統合

Last updated at Posted at 2017-11-10

追記

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とアカウント登録は済の前提

0) code-push でアプリの設定
code-push app add MY_APP_NAME ios react-native
出てきたdeployment keyをメモしておく

1) ライブラリのインストール
npm install --save react-native-code-push
react-native link react-native-code-push

※ 追記: 現在react-native link のみだとCodepush.h not found になってしまうので、マニュアルで確認必要

2) AppDelegate.mの設定

#import <CodePush/CodePush.h>

jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
を下に入れ替える

jsCodeLocation = [CodePush bundleURL];

3) 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)

4) BuildSettingに環境毎のkeyを追加
Click the + button on the toolbar and select Add User-Defined Setting

5) info.plistの修正
image.png

完了!

0
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
3