Skip to content

Commit

Permalink
Add codepush
Browse files Browse the repository at this point in the history
  • Loading branch information
robertying committed Apr 11, 2019
1 parent e08e8de commit 107f3b8
Show file tree
Hide file tree
Showing 13 changed files with 582 additions and 53 deletions.
4 changes: 3 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ project.ext.react = [

apply from: '../../node_modules/react-native-unimodules/gradle.groovy'
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"

project.ext.vectoricons = [
iconFontNames:
Expand Down Expand Up @@ -123,7 +124,7 @@ android {
renderscriptTargetApi 23
renderscriptSupportModeEnabled true
versionCode Integer.parseInt(VERSION_CODE)
versionName "1.2.0"
versionName "1.3.0"
}
signingConfigs {
if (CI) {
Expand Down Expand Up @@ -181,6 +182,7 @@ android {
}

dependencies {
implementation project(':react-native-code-push')
implementation project(':@react-native-community_blur')
implementation project(':react-native-linear-gradient')
implementation project(':rn-fetch-blob')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import com.RNFetchBlob.RNFetchBlobPackage;
import com.facebook.react.ReactApplication;
import com.microsoft.codepush.react.CodePush;
import com.cmcewen.blurview.BlurViewPackage;
import com.BV.LinearGradient.LinearGradientPackage;
import com.facebook.react.ReactNativeHost;
Expand Down Expand Up @@ -44,6 +45,12 @@ public class MainApplication extends Application implements ShareApplication, Re
), Arrays.<SingletonModule>asList());

private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {

@Override
protected String getJSBundleFile() {
return CodePush.getJSBundleFile();
}

@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
Expand All @@ -53,6 +60,7 @@ public boolean getUseDeveloperSupport() {
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new CodePush(getResources().getString(R.string.reactNativeCodePush_androidDeploymentKey), getApplicationContext(), BuildConfig.DEBUG),
new BlurViewPackage(),
new LinearGradientPackage(),
new RNFetchBlobPackage(),
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<resources>
<string moduleConfig="true" name="reactNativeCodePush_androidDeploymentKey">85HbNLH52a6R9ukGlaQ2IU9BhaujBy9a1NntV</string>
<string name="app_name">learnX</string>
</resources>
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ org.gradle.jvmargs=-Xmx2g -XX\:MaxMetaspaceSize\=512m -XX\:+HeapDumpOnOutOfMemor
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

VERSION_CODE=13
VERSION_CODE=14
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
apply from: '../node_modules/react-native-unimodules/gradle.groovy'
include ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')
include ':@react-native-community_blur'
project(':@react-native-community_blur').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/blur/android')
include ':react-native-linear-gradient'
Expand Down
2 changes: 2 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ target 'learnX' do

pod 'react-native-blur', :path => '../node_modules/@react-native-community/blur'

pod 'CodePush', :path => '../node_modules/react-native-code-push'

end
71 changes: 45 additions & 26 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
PODS:
- Answers (1.4.0):
- Fabric (~> 1.8.0)
- Base64 (1.1.2)
- boost-for-react-native (1.63.0)
- BVLinearGradient (2.5.4):
- React
- CodePush (5.6.0):
- Base64 (~> 1.1)
- JWT (~> 3.0.0-beta.7)
- React
- SSZipArchive (~> 2.1)
- DoubleConversion (1.1.6)
- EXConstants (4.0.0):
- UMConstantsInterface
Expand All @@ -22,62 +28,64 @@ PODS:
- DoubleConversion
- glog
- glog (0.3.5)
- React (0.59.3):
- React/Core (= 0.59.3)
- JWT (3.0.0-beta.11):
- Base64 (~> 1.1.2)
- React (0.59.4):
- React/Core (= 0.59.4)
- react-native-blur (0.8.0):
- React
- react-native-webview (5.6.2):
- React
- React/Core (0.59.3):
- yoga (= 0.59.3.React)
- React/CxxBridge (0.59.3):
- React/Core (0.59.4):
- yoga (= 0.59.4.React)
- React/CxxBridge (0.59.4):
- Folly (= 2018.10.22.00)
- React/Core
- React/cxxreact
- React/jsiexecutor
- React/cxxreact (0.59.3):
- React/cxxreact (0.59.4):
- boost-for-react-native (= 1.63.0)
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React/jsinspector
- React/DevSupport (0.59.3):
- React/DevSupport (0.59.4):
- React/Core
- React/RCTWebSocket
- React/fishhook (0.59.3)
- React/jsi (0.59.3):
- React/fishhook (0.59.4)
- React/jsi (0.59.4):
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React/jsiexecutor (0.59.3):
- React/jsiexecutor (0.59.4):
- DoubleConversion
- Folly (= 2018.10.22.00)
- glog
- React/cxxreact
- React/jsi
- React/jsinspector (0.59.3)
- React/RCTActionSheet (0.59.3):
- React/jsinspector (0.59.4)
- React/RCTActionSheet (0.59.4):
- React/Core
- React/RCTAnimation (0.59.3):
- React/RCTAnimation (0.59.4):
- React/Core
- React/RCTBlob (0.59.3):
- React/RCTBlob (0.59.4):
- React/Core
- React/RCTGeolocation (0.59.3):
- React/RCTGeolocation (0.59.4):
- React/Core
- React/RCTImage (0.59.3):
- React/RCTImage (0.59.4):
- React/Core
- React/RCTNetwork
- React/RCTLinkingIOS (0.59.3):
- React/RCTLinkingIOS (0.59.4):
- React/Core
- React/RCTNetwork (0.59.3):
- React/RCTNetwork (0.59.4):
- React/Core
- React/RCTSettings (0.59.3):
- React/RCTSettings (0.59.4):
- React/Core
- React/RCTText (0.59.3):
- React/RCTText (0.59.4):
- React/Core
- React/RCTVibration (0.59.3):
- React/RCTVibration (0.59.4):
- React/Core
- React/RCTWebSocket (0.59.3):
- React/RCTWebSocket (0.59.4):
- React/Core
- React/fishhook
- React/RCTBlob
Expand All @@ -91,6 +99,7 @@ PODS:
- React
- RNVectorIcons (6.4.2):
- React
- SSZipArchive (2.1.4)
- UMBarCodeScannerInterface (1.0.0)
- UMCameraInterface (1.0.0)
- UMConstantsInterface (1.0.0)
Expand All @@ -106,11 +115,12 @@ PODS:
- UMFontInterface
- UMSensorsInterface (1.0.0)
- UMTaskManagerInterface (1.0.0)
- yoga (0.59.3.React)
- yoga (0.59.4.React)

DEPENDENCIES:
- Answers
- BVLinearGradient (from `../node_modules/react-native-linear-gradient`)
- CodePush (from `../node_modules/react-native-code-push`)
- DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
- EXConstants (from `../node_modules/expo-constants/ios`)
- EXFileSystem (from `../node_modules/expo-file-system/ios`)
Expand Down Expand Up @@ -157,12 +167,17 @@ DEPENDENCIES:
SPEC REPOS:
https://github.com/cocoapods/specs.git:
- Answers
- Base64
- boost-for-react-native
- Fabric
- JWT
- SSZipArchive

EXTERNAL SOURCES:
BVLinearGradient:
:path: "../node_modules/react-native-linear-gradient"
CodePush:
:path: "../node_modules/react-native-code-push"
DoubleConversion:
:podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
EXConstants:
Expand Down Expand Up @@ -222,8 +237,10 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
Answers: e7317ccd30e7bf55c3bacfe28adbe2304b082e49
Base64: cecfb41a004124895a7bcee567a89bae5a89d49b
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
BVLinearGradient: 8cbc5155c978f2e43098818c91d206d07aae6d30
CodePush: 300e90b3481fa82569090406165b83745de3613a
DoubleConversion: bb338842f62ab1d708ceb63ec3d999f0f3d98ecd
EXConstants: a338ed187829ab25b8817f84cd84eecc13e64fd4
EXFileSystem: 18c9980f52e3bd6a28670c17e0d33a9c1584a336
Expand All @@ -232,14 +249,16 @@ SPEC CHECKSUMS:
Fabric: d2b22f443ba195d8a7cc204da230977c72733b40
Folly: de497beb10f102453a1afa9edbf8cf8a251890de
glog: aefd1eb5dda2ab95ba0938556f34b98e2da3a60d
React: b52fdb80565505b7e4592b313a38868f5df51641
JWT: 05028b9624591bba9681bb57df2c5f95fa258bad
React: 5cb71fb1a15b5ce04794ab49e24b48ebe4c94e65
react-native-blur: cad4d93b364f91e7b7931b3fa935455487e5c33c
react-native-webview: c0ddb07676492d983068b0dbfe38ff82d49b1175
rn-fetch-blob: 766f85cabd2992300dfa1be2bc9e4e258abc6f04
RNGestureHandler: b65d391f4f570178d657b99a16ec99d09b8656b0
RNReanimated: 9497464b378759f538c539df105cda235de496c5
RNShare: 4f206fa36e384e95a0cbf79f2a92490647e93127
RNVectorIcons: 6607bd3a30291d0edb56f9bbe7ae411ee2b928b0
SSZipArchive: 41455d4b8d2b6ab93990820b50dc697c2554a322
UMBarCodeScannerInterface: 53fd3cbf24fe5c58f3ba82ac8c27f0373fbf52fa
UMCameraInterface: d5a2727e76d6b47e3201f863102c055ddbcc6206
UMConstantsInterface: 800fb8f95fca9bb2c18ae554e4cb4df4383f6cbf
Expand All @@ -252,8 +271,8 @@ SPEC CHECKSUMS:
UMReactNativeAdapter: d1ca37ccecbfa95306adeebfa5e1d5514bf3d479
UMSensorsInterface: 136a828e73e4d69694cdd8d6203a99d38471b90e
UMTaskManagerInterface: f88793bd35248182e15591e0aa5b045132312be0
yoga: 1a492113f66a35e9e583bb0434f4b8cc668dd839
yoga: 596e61c9b57751d08a22b07aba310dbd3e65ab75

PODFILE CHECKSUM: 0930d2bfe6e56ed7dd1354aa9cddf15afbe88ec1
PODFILE CHECKSUM: 1b50a010152e5432c91feca2681877af02b4940c

COCOAPODS: 1.6.1
1 change: 0 additions & 1 deletion ios/learnX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
};
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
02AD695EDBBC4BB884AA0179 /* MaterialIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = F9807CC435D44071B48B3F00 /* MaterialIcons.ttf */; };
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
Expand Down
3 changes: 2 additions & 1 deletion ios/learnX/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#import "AppDelegate.h"
#import <CodePush/CodePush.h>

#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
Expand Down Expand Up @@ -49,7 +50,7 @@ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
#ifdef DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
return [CodePush bundleURL];
#endif
}

Expand Down
8 changes: 5 additions & 3 deletions ios/learnX/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2.0</string>
<string>1.3.0</string>
<key>CFBundleSignature</key>
<string></string>
<string/>
<key>CFBundleVersion</key>
<string>13</string>
<string>14</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand Down Expand Up @@ -112,5 +112,7 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CodePushDeploymentKey</key>
<string>7NdRqz1VWpbZBJ8NZPrD8QWpPh_YSk-Jcy43tV</string>
</dict>
</plist>
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"expo-secure-store": "4.0.0",
"react": "16.8.6",
"react-native": "0.59.4",
"react-native-code-push": "^5.6.0",
"react-native-gesture-handler": "1.1.0",
"react-native-linear-gradient": "2.5.4",
"react-native-modal": "9.0.0",
Expand Down
3 changes: 2 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";
import { StatusBar } from "react-native";
import codePush from "react-native-code-push";
import { Provider } from "react-redux";
import { PersistGate } from "redux-persist/integration/react";
import SplashScreen from "./components/SplashScreen";
Expand All @@ -21,4 +22,4 @@ const App: React.FunctionComponent = () => (
</Provider>
);

export default App;
export default codePush()(App);
Loading

0 comments on commit 107f3b8

Please sign in to comment.