Skip to content

Commit c8b3285

Browse files
committed
Update gradle-wrapper.properties to use Gradle 7.6.4 and refactor CodePush integration to utilize @srcpush/react-native-code-push in App.js and package.json
1 parent d30f127 commit c8b3285

5 files changed

Lines changed: 211 additions & 208 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

Examples/CodePushDemoAppCpp/App.js

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
View,
1212
} from 'react-native';
1313

14-
import CodePush from "react-native-code-push";
14+
import CodePush from "@srcpush/react-native-code-push";
1515

1616
class App extends Component<{}> {
1717
constructor() {
@@ -20,7 +20,7 @@ class App extends Component<{}> {
2020
}
2121

2222
codePushStatusDidChange(syncStatus) {
23-
switch(syncStatus) {
23+
switch (syncStatus) {
2424
case CodePush.SyncStatus.CHECKING_FOR_UPDATE:
2525
this.setState({ syncMessage: "Checking for update." });
2626
break;
@@ -86,9 +86,9 @@ class App extends Component<{}> {
8686
this.codePushDownloadDidProgress.bind(this)
8787
);
8888
}
89-
89+
9090
restartApp() {
91-
CodePush.restartApp();
91+
CodePush.restartApp();
9292
}
9393

9494
render() {
@@ -101,35 +101,35 @@ class App extends Component<{}> {
101101
}
102102

103103
return (
104-
<SafeAreaView>
105-
<ScrollView>
106-
<View style={styles.container}>
107-
<Text style={styles.welcome}>
108-
Welcome to CodePush!
109-
</Text>
110-
<Text style={styles.welcome}>
111-
Demo bundle
112-
</Text>
113-
<TouchableOpacity onPress={this.restartApp.bind(this)}>
114-
<Text style={styles.syncButton}>Press to restart</Text>
115-
</TouchableOpacity>
116-
<TouchableOpacity onPress={this.sync.bind(this)}>
117-
<Text style={styles.syncButton}>Press for background sync</Text>
118-
</TouchableOpacity>
119-
<TouchableOpacity onPress={this.syncImmediate.bind(this)}>
120-
<Text style={styles.syncButton}>Press for dialog-driven sync</Text>
121-
</TouchableOpacity>
122-
{progressView}
123-
<TouchableOpacity onPress={this.toggleAllowRestart.bind(this)}>
124-
<Text style={styles.restartToggleButton}>Restart { this.state.restartAllowed ? "allowed" : "forbidden"}</Text>
125-
</TouchableOpacity>
126-
<TouchableOpacity onPress={this.getUpdateMetadata.bind(this)}>
127-
<Text style={styles.syncButton}>Press for Update Metadata</Text>
128-
</TouchableOpacity>
129-
<Text style={styles.messages}>{this.state.syncMessage || ""}</Text>
130-
</View>
131-
</ScrollView>
132-
</SafeAreaView>
104+
<SafeAreaView>
105+
<ScrollView>
106+
<View style={styles.container}>
107+
<Text style={styles.welcome}>
108+
Welcome to CodePush!
109+
</Text>
110+
<Text style={styles.welcome}>
111+
Demo bundle
112+
</Text>
113+
<TouchableOpacity onPress={this.restartApp.bind(this)}>
114+
<Text style={styles.syncButton}>Press to restart</Text>
115+
</TouchableOpacity>
116+
<TouchableOpacity onPress={this.sync.bind(this)}>
117+
<Text style={styles.syncButton}>Press for background sync</Text>
118+
</TouchableOpacity>
119+
<TouchableOpacity onPress={this.syncImmediate.bind(this)}>
120+
<Text style={styles.syncButton}>Press for dialog-driven sync</Text>
121+
</TouchableOpacity>
122+
{progressView}
123+
<TouchableOpacity onPress={this.toggleAllowRestart.bind(this)}>
124+
<Text style={styles.restartToggleButton}>Restart {this.state.restartAllowed ? "allowed" : "forbidden"}</Text>
125+
</TouchableOpacity>
126+
<TouchableOpacity onPress={this.getUpdateMetadata.bind(this)}>
127+
<Text style={styles.syncButton}>Press for Update Metadata</Text>
128+
</TouchableOpacity>
129+
<Text style={styles.messages}>{this.state.syncMessage || ""}</Text>
130+
</View>
131+
</ScrollView>
132+
</SafeAreaView>
133133
);
134134
}
135135
}

Examples/CodePushDemoAppCpp/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"dependencies": {
1212
"react": "^17.0.2",
1313
"react-native": "^0.68.5",
14-
"react-native-code-push": "^8.1.0",
14+
"@srcpush/react-native-code-push": "^1.0.1",
1515
"react-native-windows": "^1.0.0"
1616
},
1717
"resolutions": {
@@ -33,4 +33,4 @@
3333
"jest": {
3434
"preset": "react-native"
3535
}
36-
}
36+
}

0 commit comments

Comments
 (0)