Skip to content

Commit

Permalink
refactor: update apns sample app to 0.72.4 (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
ami-aman committed Aug 24, 2023
1 parent d8c254a commit a0ba428
Show file tree
Hide file tree
Showing 6 changed files with 2,934 additions and 1,514 deletions.
6 changes: 3 additions & 3 deletions Apps/APN/ios/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import "SampleApp-Swift.h"
#import <React/RCTAppSetupUtils.h>
#import <RCTAppSetupUtils.h>
#import <UserNotifications/UserNotifications.h>
#import <RNCPushNotificationIOS.h>
#import <React/RCTLinkingManager.h>
Expand Down Expand Up @@ -36,7 +36,7 @@ @implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RCTAppSetupPrepareApp(application);
RCTAppSetupPrepareApp(application, true);

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

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

if (@available(iOS 13.0, *)) {
rootView.backgroundColor = [UIColor systemBackgroundColor];
Expand Down
17 changes: 15 additions & 2 deletions Apps/APN/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip

platform :ios, '13.0'
install! 'cocoapods', :deterministic_uuids => false
Expand Down Expand Up @@ -32,6 +35,16 @@ target 'SampleApp' do
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
# Added this post installer
post_install do |installer|
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false
)
end

end

target 'NotificationServiceExtension' do
Expand Down

0 comments on commit a0ba428

Please sign in to comment.