Skip to content

Commit 88d36de

Browse files
committed
fix(Expo): fix app stuck on splash screen in SDK 54
1 parent ae5e8bb commit 88d36de

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

expo/plugin/withCodePushAndroid.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,19 @@ const withAndroidMainApplicationDependency = (config) => {
6868
if (action.modResults.contents.includes(RN_082_MARKER)) {
6969
action.modResults.contents = addJsBundleFilePathArgument(action.modResults.contents);
7070
} else {
71+
// https://github.com/Soomgo-Mobile/react-native-code-push/issues/97
72+
const isExpoSDK54 = config.sdkVersion?.startsWith('54.') ?? false;
73+
const addingCode = isExpoSDK54
74+
? ' override fun getJSBundleFile(): String {\n' +
75+
' CodePush.getInstance(applicationContext, BuildConfig.DEBUG)\n' +
76+
' return CodePush.getJSBundleFile()\n' +
77+
' }\n'
78+
: ' override fun getJSBundleFile(): String = CodePush.getJSBundleFile()\n';
7179
action.modResults.contents = androidMainApplicationApplyImplementation(
7280
action.modResults.contents,
7381
'object : DefaultReactNativeHost(this) {',
74-
' override fun getJSBundleFile(): String = CodePush.getJSBundleFile()\n');
82+
addingCode,
83+
);
7584
}
7685
}
7786

0 commit comments

Comments
 (0)