Skip to content

Commit dfe4701

Browse files
committed
Add support for Expo 53
1 parent d040be3 commit dfe4701

File tree

3 files changed

+23
-15
lines changed

3 files changed

+23
-15
lines changed

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,7 +1654,7 @@ PODS:
16541654
- React-logger (= 0.79.0)
16551655
- React-perflogger (= 0.79.0)
16561656
- React-utils (= 0.79.0)
1657-
- RNBootSplash (6.3.4):
1657+
- RNBootSplash (6.3.5):
16581658
- DoubleConversion
16591659
- glog
16601660
- hermes-engine
@@ -1975,7 +1975,7 @@ SPEC CHECKSUMS:
19751975
ReactAppDependencyProvider: 7f5052913dd72a0e84ca95973f9f8bc97f2c5b95
19761976
ReactCodegen: 16700ce5938fd79c1ff4c5b5735f10830f2e6bd3
19771977
ReactCommon: 1257efa9d0b07517d8b79bb4055eaefac1204807
1978-
RNBootSplash: b40b84e4a6f5dd6abf9c301a878edabc66deee49
1978+
RNBootSplash: 20de3aeff927f38b7a85275033e4459563c908e1
19791979
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
19801980
Yoga: 9773f1327b258fa449988c2e42fbb7cbdf655d96
19811981

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-bootsplash",
3-
"version": "6.3.4",
3+
"version": "6.3.5",
44
"license": "MIT",
55
"description": "Display a bootsplash on your app starts. Hide it when you want.",
66
"author": "Mathieu Acthernoene <[email protected]>",

src/expo.ts

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { assignColorValue } from "@expo/config-plugins/build/android/Colors";
33
import { addImports } from "@expo/config-plugins/build/android/codeMod";
44
import { mergeContents } from "@expo/config-plugins/build/utils/generateCode";
55
import path from "path";
6+
import semver from "semver";
67
import { dedent } from "ts-dedent";
78
import { Manifest } from ".";
89
import { cleanIOSAssets, getExpoConfig, hfs, log } from "./generate";
@@ -276,7 +277,7 @@ const withIOSAssets: Expo.ConfigPlugin<Props> = (config, props) =>
276277

277278
const withAppDelegate: Expo.ConfigPlugin<Props> = (config) =>
278279
Expo.withAppDelegate(config, (config) => {
279-
const { modResults } = config;
280+
const { modResults, sdkVersion = "0.1.0" } = config;
280281
const { language } = modResults;
281282

282283
if (language !== "objc" && language !== "objcpp" && language !== "swift") {
@@ -303,18 +304,25 @@ const withAppDelegate: Expo.ConfigPlugin<Props> = (config) =>
303304
offset: swift ? 1 : 0,
304305
anchor: swift ? /public class AppDelegate: ExpoAppDelegate {/ : /@end/,
305306
newSrc: swift
306-
? dedent`
307-
override func customize(_ rootView: RCTRootView!) {
308-
super.customize(rootView)
309-
RNBootSplash.initWithStoryboard("BootSplash", rootView: rootView)
310-
}
311-
`
307+
? semver.major(sdkVersion) >= 53
308+
? dedent`
309+
public override func customize(_ rootView: RCTRootView) {
310+
super.customize(rootView)
311+
RNBootSplash.initWithStoryboard("BootSplash", rootView: rootView)
312+
}
313+
`
314+
: dedent`
315+
override func customize(_ rootView: RCTRootView!) {
316+
super.customize(rootView)
317+
RNBootSplash.initWithStoryboard("BootSplash", rootView: rootView)
318+
}
319+
`
312320
: dedent`
313-
- (void)customizeRootView:(RCTRootView *)rootView {
314-
[super customizeRootView:rootView];
315-
[RNBootSplash initWithStoryboard:@"BootSplash" rootView:rootView];
316-
}
317-
`,
321+
- (void)customizeRootView:(RCTRootView *)rootView {
322+
[super customizeRootView:rootView];
323+
[RNBootSplash initWithStoryboard:@"BootSplash" rootView:rootView];
324+
}
325+
`,
318326
});
319327

320328
return {

0 commit comments

Comments
 (0)