How to write the new RCT AppDelegate interface with User Notifications in ios on react-native

62 views Asked by At

I've recently upgraded my react-native SDK version to 0.73, But according to the Upgrade Helper here the AppDelegate interface definition changed from

@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>

to

@interface AppDelegate : RCTAppDelegate

But as my project uses "UserNotifications" which should be used to extend/implement the AppDelegate interface, I couldn't figure out how to extend this new interface.

1

There are 1 answers

0
ofundefined On

Alrighty, found it here: https://github.com/zo0r/react-native-push-notification/issues/2344

To extend the AppDelegate interface with the latest react-native, I should use the obvious

#import <RCTAppDelegate.h>
#import <UIKit/UIKit.h>
#import <UserNotifications/UNUserNotificationCenter.h>

@interface AppDelegate : RCTAppDelegate <UNUserNotificationCenterDelegate>

@end