Skip to content

Commit a0ba428

Browse files
authored
refactor: update apns sample app to 0.72.4 (#188)
1 parent d8c254a commit a0ba428

6 files changed

Lines changed: 2934 additions & 1514 deletions

File tree

Apps/APN/ios/AppDelegate.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#import <React/RCTBundleURLProvider.h>
55
#import <React/RCTRootView.h>
66
#import "SampleApp-Swift.h"
7-
#import <React/RCTAppSetupUtils.h>
7+
#import <RCTAppSetupUtils.h>
88
#import <UserNotifications/UserNotifications.h>
99
#import <RNCPushNotificationIOS.h>
1010
#import <React/RCTLinkingManager.h>
@@ -36,7 +36,7 @@ @implementation AppDelegate
3636

3737
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
3838
{
39-
RCTAppSetupPrepareApp(application);
39+
RCTAppSetupPrepareApp(application, true);
4040

4141
NSMutableDictionary *modifiedLaunchOptions = [NSMutableDictionary dictionaryWithDictionary:launchOptions];
4242
if (launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey]) {
@@ -60,7 +60,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
6060
#endif
6161

6262
NSDictionary *initProps = [self prepareInitialProps];
63-
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"SampleApp", initProps);
63+
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"SampleApp", initProps, true);
6464

6565
if (@available(iOS 13.0, *)) {
6666
rootView.backgroundColor = [UIColor systemBackgroundColor];

Apps/APN/ios/Podfile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
require_relative '../node_modules/react-native/scripts/react_native_pods'
2-
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
1+
require Pod::Executable.execute_command('node', ['-p',
2+
'require.resolve(
3+
"react-native/scripts/react_native_pods.rb",
4+
{paths: [process.argv[1]]},
5+
)', __dir__]).strip
36

47
platform :ios, '13.0'
58
install! 'cocoapods', :deterministic_uuids => false
@@ -32,6 +35,16 @@ target 'SampleApp' do
3235
# An absolute path to your application root.
3336
:app_path => "#{Pod::Config.instance.installation_root}/.."
3437
)
38+
# Added this post installer
39+
post_install do |installer|
40+
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
41+
react_native_post_install(
42+
installer,
43+
config[:reactNativePath],
44+
:mac_catalyst_enabled => false
45+
)
46+
end
47+
3548
end
3649

3750
target 'NotificationServiceExtension' do

0 commit comments

Comments
 (0)