code push changes | tested with updated (#71)

This commit is contained in:
Aman Singh
2023-01-20 16:16:20 +05:30
committed by GitHub Enterprise
parent e7aa1f6c69
commit dad8685bc0
11 changed files with 573 additions and 31 deletions

View File

@@ -14,6 +14,7 @@ import ErrorBoundary from './src/common/ErrorBoundary';
import * as Sentry from '@sentry/browser';
import { SENTRY_DSN } from './src/constants/config';
import useNativeButtons from './src/hooks/useNativeButton';
import codePush from 'react-native-code-push';
Sentry.init({ dsn: SENTRY_DSN });
@@ -35,4 +36,4 @@ const App = () => {
);
};
export default App;
export default codePush(App);

View File

@@ -84,6 +84,7 @@ project.ext.react = [
]
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
/**
* Set this to true to create two separate APKs instead of one:
@@ -140,7 +141,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 24
versionName "Address verification"
versionName "1"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
if (isNewArchitectureEnabled()) {
@@ -218,6 +219,14 @@ android {
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
storeFile file(MYAPP_UPLOAD_STORE_FILE)
storePassword MYAPP_UPLOAD_STORE_PASSWORD
keyAlias MYAPP_UPLOAD_KEY_ALIAS
keyPassword MYAPP_UPLOAD_KEY_PASSWORD
}
}
}
buildTypes {
debug {
@@ -226,7 +235,7 @@ android {
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.debug
signingConfig signingConfigs.release
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}

View File

@@ -0,0 +1,3 @@
{
"app_secret": "f88ae79c-c397-499d-8e40-1f1c1849eb19"
}

View File

@@ -12,6 +12,7 @@ import com.facebook.soloader.SoLoader;
import com.avapp.newarchitecture.MainApplicationReactNativeHost;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import com.microsoft.codepush.react.CodePush;
public class MainApplication extends Application implements ReactApplication {
@@ -35,6 +36,10 @@ public class MainApplication extends Application implements ReactApplication {
protected String getJSMainModuleName() {
return "index";
}
@Override
protected String getJSBundleFile() {
return CodePush.getJSBundleFile();
}
};
private final ReactNativeHost mNewArchitectureNativeHost =

View File

@@ -1,3 +1,6 @@
<resources>
<string name="app_name">Address verification</string>
<string name="appCenterCrashes_whenToSendCrashes" moduleConfig="true" translatable="false">DO_NOT_ASK_JAVASCRIPT</string>
<string name="appCenterAnalytics_whenToEnableAnalytics" moduleConfig="true" translatable="false">ALWAYS_SEND</string>
<string moduleConfig="true" name="CodePushDeploymentKey">AWRE2FXatjNzKAOvmX8GId9mZ4OKjqHoLcf9T</string>
</resources>

View File

@@ -38,3 +38,8 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
MYAPP_UPLOAD_STORE_FILE=my-upload-key.keystore
MYAPP_UPLOAD_KEY_ALIAS=my-key-alias
MYAPP_UPLOAD_STORE_PASSWORD=Navi@123
MYAPP_UPLOAD_KEY_PASSWORD=Navi@123

View File

@@ -1,6 +1,6 @@
rootProject.name = 'AVAPP'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
include ':app', ':react-native-code-push'
includeBuild('../node_modules/react-native-gradle-plugin')
if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
@@ -9,3 +9,4 @@ if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true")
include(":ReactAndroid:hermes-engine")
project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
}
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')

View File

@@ -11,7 +11,7 @@
"prettier:write": "npx prettier --write **/*.{js,jsx,ts,tsx,json} && npx prettier --write *.{js,jsx,ts,tsx,json}",
"lint": "tsc --noEmit && eslint --ext .js,.jsx,.ts,.tsx ./",
"release:dev": "yarn move:dev && react-native run-android --variant=release && cd android && ./gradlew assembleDebug",
"release:qa": "yarn move:qa && react-native run-android --variant=release && cd android && ./gradlew assembleDebug",
"release:qa": "yarn move:qa && react-native run-android --variant=release && cd android && ./gradlew assembleRelease",
"move:dev": "cp -f ./config/dev/config.js ./src/constants && cp -f ./config/dev/google-services.json ./android/app",
"move:qa": "cp -f ./config/qa/config.js ./src/constants && cp -f ./config/qa/google-services.json ./android/app"
},
@@ -29,12 +29,16 @@
"@react-navigation/native-stack": "6.9.4",
"@reduxjs/toolkit": "1.9.1",
"@sentry/browser": "7.29.0",
"appcenter": "^4.4.5",
"appcenter-analytics": "^4.4.5",
"appcenter-crashes": "^4.4.5",
"axios": "1.2.1",
"fuzzysort": "2.0.4",
"lottie-react-native": "5.1.4",
"react": "18.1.0",
"react-hook-form": "7.40.0",
"react-native": "0.70.6",
"react-native-code-push": "7.1.0",
"react-native-device-info": "10.3.0",
"react-native-image-picker": "4.10.2",
"react-native-pager-view": "6.1.2",

View File

@@ -1,3 +1,3 @@
export const BASE_AV_APP_URL = 'https://qa-longhorn-server.np.navi-tech.in/av';
export const SENTRY_DSN = 'https://877396e88a2b4f78b911016c64f9121a@glitchtip.cmd.navi-tech.in/155';
export const JANUS_SERVICE_URL = 'https://dev-longhorn-portal.np.navi-tech.in/api/events/json';
export const JANUS_SERVICE_URL = 'https://qa-longhorn-portal.np.navi-tech.in/api/events/json';

559
yarn.lock

File diff suppressed because it is too large Load Diff