Skip to content

Commit

Permalink
added ota update (#13)
Browse files Browse the repository at this point in the history
* added ota update

* changed android version to 1.1.0
  • Loading branch information
Diwakar-Gupta authored Dec 29, 2023
1 parent 3386e99 commit ee28bbd
Show file tree
Hide file tree
Showing 11 changed files with 926 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:
echo "VERSION_NAME=${{ github.event.inputs.VERSION_NAME }}" >> .env
echo "SKIP_DEVELOPER_MODE_CHECK=${{ github.event.inputs.SKIP_DEVELOPER_MODE_CHECK }}" >> .env
sh ./setup/run.sh
cd android
./gradlew assembleRelease
Expand Down
3 changes: 2 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 24
versionName "1.0.0"
versionName "1.1.0"
}
signingConfigs {
debug {
Expand Down Expand Up @@ -126,3 +126,4 @@ apply from: file("../../node_modules/@react-native-community/cli-platform-androi


apply plugin: 'com.google.gms.google-services'
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
3 changes: 3 additions & 0 deletions android/app/src/main/assets/appcenter-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"app_secret": "8471b7e5-5f80-46f2-8105-4fc7e1afcafb"
}
6 changes: 6 additions & 0 deletions android/app/src/main/java/com/sst/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.facebook.soloader.SoLoader;
import com.zaguiini.RNPureJwt.RNPureJwtPackage;
import java.util.List;
import com.microsoft.codepush.react.CodePush;

public class MainApplication extends Application implements ReactApplication {

Expand All @@ -35,6 +36,11 @@ protected String getJSMainModuleName() {
return "index";
}

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

@Override
protected boolean isNewArchEnabled() {
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
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 name="app_name">Scaler School of Technology</string>
<string moduleConfig="true" name="CodePushDeploymentKey">0n85BoKK6o4OkStSsQi0CL_ArdQNz8Sh9sRGl</string>
</resources>
3 changes: 3 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ include ':app'
include ':react-native-pure-jwt'
project(':react-native-pure-jwt').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-pure-jwt/android')
includeBuild('../node_modules/@react-native/gradle-plugin')

include ':app', ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import codePush from 'react-native-code-push';

import messaging from '@react-native-firebase/messaging';

messaging().setBackgroundMessageHandler(async remoteMessage => {
console.log('Message handled in background.', remoteMessage.notification);
});

AppRegistry.registerComponent(appName, () => App);
AppRegistry.registerComponent(appName, () => codePush(App));
Loading

0 comments on commit ee28bbd

Please sign in to comment.