Skip to content

Commit 286b0f0

Browse files
committed
conditionally rendering based on env profile and pushed the build version 5 for both apps
1 parent 634d3fa commit 286b0f0

File tree

15 files changed

+7889
-7765
lines changed

15 files changed

+7889
-7765
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ coverage
1818
# macOS
1919
.DS_Store
2020

21+
2122
# @generated expo-cli sync-e7dcf75f4e856f7b6f3239b3f3a7dd614ee755a8
2223
# The following patterns were generated by expo-cli
2324

@@ -77,4 +78,4 @@ buck-out/
7778
web-build/
7879
dist/
7980

80-
# @end expo-cli
81+
# @end expo-cli

App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ export default function App() {
4444
Rubik_500Medium,
4545
});
4646

47+
// console.log("process.env.NODE_ENV: ", process.env.NODE_ENV);
48+
4749
useEffect(() => {
4850
StatusBar.setBarStyle("dark-content");
4951

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ android {
135135
applicationId 'com.aceiotsolutions.connecting_mha_app'
136136
minSdkVersion rootProject.ext.minSdkVersion
137137
targetSdkVersion rootProject.ext.targetSdkVersion
138-
versionCode 4
139-
versionName "0.0.4"
138+
versionCode 5
139+
versionName "0.0.5"
140140
}
141141
splits {
142142
abi {
Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,69 @@
1-
/**
2-
* Copyright (c) Facebook, Inc. and its affiliates.
3-
*
4-
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
5-
* directory of this source tree.
6-
*/
7-
package com.aceiotsolutions.connecting_mha_app;
8-
9-
import android.content.Context;
10-
import com.facebook.flipper.android.AndroidFlipperClient;
11-
import com.facebook.flipper.android.utils.FlipperUtils;
12-
import com.facebook.flipper.core.FlipperClient;
13-
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
14-
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
15-
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
16-
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
17-
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
18-
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
19-
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
20-
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
21-
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
22-
import com.facebook.react.ReactInstanceManager;
23-
import com.facebook.react.bridge.ReactContext;
24-
import com.facebook.react.modules.network.NetworkingModule;
25-
import okhttp3.OkHttpClient;
26-
27-
public class ReactNativeFlipper {
28-
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
29-
if (FlipperUtils.shouldEnableFlipper(context)) {
30-
final FlipperClient client = AndroidFlipperClient.getInstance(context);
31-
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
32-
client.addPlugin(new ReactFlipperPlugin());
33-
client.addPlugin(new DatabasesFlipperPlugin(context));
34-
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
35-
client.addPlugin(CrashReporterPlugin.getInstance());
36-
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
37-
NetworkingModule.setCustomClientBuilder(
38-
new NetworkingModule.CustomClientBuilder() {
39-
@Override
40-
public void apply(OkHttpClient.Builder builder) {
41-
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
42-
}
43-
});
44-
client.addPlugin(networkFlipperPlugin);
45-
client.start();
46-
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
47-
// Hence we run if after all native modules have been initialized
48-
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
49-
if (reactContext == null) {
50-
reactInstanceManager.addReactInstanceEventListener(
51-
new ReactInstanceManager.ReactInstanceEventListener() {
52-
@Override
53-
public void onReactContextInitialized(ReactContext reactContext) {
54-
reactInstanceManager.removeReactInstanceEventListener(this);
55-
reactContext.runOnNativeModulesQueueThread(
56-
new Runnable() {
57-
@Override
58-
public void run() {
59-
client.addPlugin(new FrescoFlipperPlugin());
60-
}
61-
});
62-
}
63-
});
64-
} else {
65-
client.addPlugin(new FrescoFlipperPlugin());
66-
}
67-
}
68-
}
1+
/**
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*
4+
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
5+
* directory of this source tree.
6+
*/
7+
package com.aceiotsolutions.connecting_mha_app;
8+
9+
import android.content.Context;
10+
import com.facebook.flipper.android.AndroidFlipperClient;
11+
import com.facebook.flipper.android.utils.FlipperUtils;
12+
import com.facebook.flipper.core.FlipperClient;
13+
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
14+
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
15+
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
16+
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
17+
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
18+
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
19+
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
20+
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
21+
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
22+
import com.facebook.react.ReactInstanceManager;
23+
import com.facebook.react.bridge.ReactContext;
24+
import com.facebook.react.modules.network.NetworkingModule;
25+
import okhttp3.OkHttpClient;
26+
27+
public class ReactNativeFlipper {
28+
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
29+
if (FlipperUtils.shouldEnableFlipper(context)) {
30+
final FlipperClient client = AndroidFlipperClient.getInstance(context);
31+
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
32+
client.addPlugin(new ReactFlipperPlugin());
33+
client.addPlugin(new DatabasesFlipperPlugin(context));
34+
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
35+
client.addPlugin(CrashReporterPlugin.getInstance());
36+
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
37+
NetworkingModule.setCustomClientBuilder(
38+
new NetworkingModule.CustomClientBuilder() {
39+
@Override
40+
public void apply(OkHttpClient.Builder builder) {
41+
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
42+
}
43+
});
44+
client.addPlugin(networkFlipperPlugin);
45+
client.start();
46+
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
47+
// Hence we run if after all native modules have been initialized
48+
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
49+
if (reactContext == null) {
50+
reactInstanceManager.addReactInstanceEventListener(
51+
new ReactInstanceManager.ReactInstanceEventListener() {
52+
@Override
53+
public void onReactContextInitialized(ReactContext reactContext) {
54+
reactInstanceManager.removeReactInstanceEventListener(this);
55+
reactContext.runOnNativeModulesQueueThread(
56+
new Runnable() {
57+
@Override
58+
public void run() {
59+
client.addPlugin(new FrescoFlipperPlugin());
60+
}
61+
});
62+
}
63+
});
64+
} else {
65+
client.addPlugin(new FrescoFlipperPlugin());
66+
}
67+
}
68+
}
6969
}

android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
1818
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
1919
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://exp.host/@ace-iot/connecting-mha-app"/>
20-
<activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:screenOrientation="portrait" android:exported="true">
20+
<activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:screenOrientation="portrait">
2121
<intent-filter>
2222
<action android:name="android.intent.action.MAIN"/>
2323
<category android:name="android.intent.category.LAUNCHER"/>

app.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"expo": {
33
"name": "Connecting MHA",
44
"slug": "connecting-mha-app",
5-
"version": "0.0.4",
5+
"version": "0.0.5",
66
"orientation": "portrait",
77
"owner": "ace-iot",
88
"icon": "./assets/icon.png",
@@ -25,7 +25,7 @@
2525
"foregroundImage": "./assets/icon.adaptive.foreground.png",
2626
"backgroundImage": "./assets/icon.adaptive.background.png"
2727
},
28-
"versionCode": 4,
28+
"versionCode": 5,
2929
"package": "com.aceiotsolutions.connecting_mha_app"
3030
},
3131
"web": {

eas.json

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
1-
{
2-
"cli": {
3-
"version": ">= 0.38.3",
4-
"promptToConfigurePushNotifications": false
5-
},
6-
"build": {
7-
"acceptance": {
8-
"distribution": "internal"
9-
},
10-
"production": {}
11-
},
12-
"submit": {
13-
"acceptance": {},
14-
"production": {
15-
"android": {
16-
"track": "internal"
17-
}
18-
}
19-
}
20-
}
1+
{
2+
"cli": {
3+
"version": ">= 0.38.3",
4+
"promptToConfigurePushNotifications": false
5+
},
6+
"build": {
7+
"acceptance": {
8+
"distribution": "internal"
9+
},
10+
"production": {
11+
"env": {
12+
"profile": "production"
13+
}
14+
}
15+
},
16+
"submit": {
17+
"acceptance": {},
18+
"production": {
19+
"android": {
20+
"track": "internal"
21+
}
22+
}
23+
}
24+
}

ios/ConnectingMHA.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
1111
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
1212
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
13-
2612DA6260364A5EB782D824 /* noop-file.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36657432BA1E4D11ADB5FF96 /* noop-file.swift */; };
1413
3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */; };
1514
96905EF65AED1B983A6B3ABC /* libPods-ConnectingMHA.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58EEBF8E8E6FB1BC6CAF49B5 /* libPods-ConnectingMHA.a */; };
1615
B18059E884C0ABDD17F3DC3D /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */; };
1716
BB2F792D24A3F905000567C9 /* Expo.plist in Resources */ = {isa = PBXBuildFile; fileRef = BB2F792C24A3F905000567C9 /* Expo.plist */; };
17+
FA4B69D4F42D437F89CC257A /* noop-file.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4315697A2BC4E19A8E4E444 /* noop-file.swift */; };
1818
/* End PBXBuildFile section */
1919

2020
/* Begin PBXFileReference section */
@@ -25,12 +25,12 @@
2525
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = ConnectingMHA/Images.xcassets; sourceTree = "<group>"; };
2626
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ConnectingMHA/Info.plist; sourceTree = "<group>"; };
2727
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ConnectingMHA/main.m; sourceTree = "<group>"; };
28-
36657432BA1E4D11ADB5FF96 /* noop-file.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = "noop-file.swift"; path = "ConnectingMHA/noop-file.swift"; sourceTree = "<group>"; };
29-
50CA8D496B814A4B8B3394D4 /* ConnectingMHA-Bridging-Header.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "ConnectingMHA-Bridging-Header.h"; path = "ConnectingMHA/ConnectingMHA-Bridging-Header.h"; sourceTree = "<group>"; };
3028
58EEBF8E8E6FB1BC6CAF49B5 /* libPods-ConnectingMHA.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ConnectingMHA.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3129
6C2E3173556A471DD304B334 /* Pods-ConnectingMHA.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ConnectingMHA.debug.xcconfig"; path = "Target Support Files/Pods-ConnectingMHA/Pods-ConnectingMHA.debug.xcconfig"; sourceTree = "<group>"; };
3230
7A4D352CD337FB3A3BF06240 /* Pods-ConnectingMHA.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ConnectingMHA.release.xcconfig"; path = "Target Support Files/Pods-ConnectingMHA/Pods-ConnectingMHA.release.xcconfig"; sourceTree = "<group>"; };
31+
937A4A0F94C84277A2966A0C /* ConnectingMHA-Bridging-Header.h */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.c.h; name = "ConnectingMHA-Bridging-Header.h"; path = "ConnectingMHA/ConnectingMHA-Bridging-Header.h"; sourceTree = "<group>"; };
3332
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = SplashScreen.storyboard; path = ConnectingMHA/SplashScreen.storyboard; sourceTree = "<group>"; };
33+
B4315697A2BC4E19A8E4E444 /* noop-file.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = "noop-file.swift"; path = "ConnectingMHA/noop-file.swift"; sourceTree = "<group>"; };
3434
BB2F792C24A3F905000567C9 /* Expo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Expo.plist; sourceTree = "<group>"; };
3535
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
3636
FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-ConnectingMHA/ExpoModulesProvider.swift"; sourceTree = "<group>"; };
@@ -59,8 +59,8 @@
5959
13B07FB61A68108700A75B9A /* Info.plist */,
6060
13B07FB71A68108700A75B9A /* main.m */,
6161
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */,
62-
36657432BA1E4D11ADB5FF96 /* noop-file.swift */,
63-
50CA8D496B814A4B8B3394D4 /* ConnectingMHA-Bridging-Header.h */,
62+
B4315697A2BC4E19A8E4E444 /* noop-file.swift */,
63+
937A4A0F94C84277A2966A0C /* ConnectingMHA-Bridging-Header.h */,
6464
);
6565
name = ConnectingMHA;
6666
sourceTree = "<group>";
@@ -294,7 +294,7 @@
294294
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
295295
13B07FC11A68108700A75B9A /* main.m in Sources */,
296296
B18059E884C0ABDD17F3DC3D /* ExpoModulesProvider.swift in Sources */,
297-
2612DA6260364A5EB782D824 /* noop-file.swift in Sources */,
297+
FA4B69D4F42D437F89CC257A /* noop-file.swift in Sources */,
298298
);
299299
runOnlyForDeploymentPostprocessing = 0;
300300
};

ios/ConnectingMHA/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>0.0.4</string>
20+
<string>0.0.5</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleURLTypes</key>
@@ -30,7 +30,7 @@
3030
</dict>
3131
</array>
3232
<key>CFBundleVersion</key>
33-
<string>4</string>
33+
<string>5</string>
3434
<key>LSRequiresIPhoneOS</key>
3535
<true/>
3636
<key>NSAppTransportSecurity</key>

0 commit comments

Comments
 (0)