From dee39e345d39769488a4757872b3afbd4ee002a1 Mon Sep 17 00:00:00 2001 From: Emilio Pavia Date: Thu, 17 Mar 2022 18:17:34 +0100 Subject: [PATCH] chore: [IA-715] Cleanup in the Android main activity (#3835) * Remove unused showAlertDialog * Remove isRootedDeviceFlag * Change module name Co-authored-by: Matteo Boschi --- .../src/main/java/it/pagopa/io/app/MainActivity.java | 11 +---------- app.json | 6 +++--- index.js | 3 ++- ios/ItaliaApp/AppDelegate.m | 2 +- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/android/app/src/main/java/it/pagopa/io/app/MainActivity.java b/android/app/src/main/java/it/pagopa/io/app/MainActivity.java index 1956c277afb..ea264117a24 100644 --- a/android/app/src/main/java/it/pagopa/io/app/MainActivity.java +++ b/android/app/src/main/java/it/pagopa/io/app/MainActivity.java @@ -14,15 +14,13 @@ public class MainActivity extends ReactActivity { - private Boolean isRootedDeviceFlag = null; - /** * Returns the name of the main component registered from JavaScript. This is * used to schedule rendering of the component. */ @Override protected String getMainComponentName() { - return "ItaliaApp"; + return "IO"; } // see @@ -47,11 +45,4 @@ protected ReactRootView createRootView() { } }; } - - - private void showAlertDialog(String title, String message) { - new AlertDialog.Builder(MainActivity.this).setTitle(title).setMessage(message) - .setPositiveButton(getString(android.R.string.ok), (dialog, which) -> finish()).setCancelable(false) - .show(); - } } diff --git a/app.json b/app.json index e93e7e77b46..7a16ce0972e 100644 --- a/app.json +++ b/app.json @@ -1,4 +1,4 @@ { - "name": "ItaliaApp", - "displayName": "ItaliaApp" -} \ No newline at end of file + "name": "IO", + "displayName": "IO" +} diff --git a/index.js b/index.js index 1cef3e55866..781371b2f07 100644 --- a/index.js +++ b/index.js @@ -19,6 +19,7 @@ import { import { App } from "./ts/App"; import { mixpanel } from "./ts/mixpanel"; +import { name as appName } from "./app.json"; const errorHandler = (e, isFatal) => { if (isFatal) { @@ -68,4 +69,4 @@ Text.defaultProps.allowFontScaling = false; TextInput.defaultProps = TextInput.defaultProps || {}; TextInput.defaultProps.allowFontScaling = false; -AppRegistry.registerComponent("ItaliaApp", () => App); +AppRegistry.registerComponent(appName, () => App); diff --git a/ios/ItaliaApp/AppDelegate.m b/ios/ItaliaApp/AppDelegate.m index c6cc4d507bd..8881b31f577 100644 --- a/ios/ItaliaApp/AppDelegate.m +++ b/ios/ItaliaApp/AppDelegate.m @@ -50,7 +50,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( #endif RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge - moduleName:@"ItaliaApp" + moduleName:@"IO" initialProperties:nil]; if (@available(iOS 13.0, *)) {