[docs] [expo-notifications] missing instructions for notifications listeners to work on iOS when adding the library to an existing app
See original GitHub issueWhen adding expo-notifications in an existing react-native application, notification listeners does not fire on iOS unless we set the expo-notifications delegate in didFinishLaunchingWithOptions
function in the file AppDelegate.m
id<EXNotificationCenterDelegate> notificationCenterDelegate = (id<EXNotificationCenterDelegate>) [UMModuleRegistryProvider getSingletonModuleForClass:[EXNotificationCenterDelegate class]];
[[UNUserNotificationCenter currentNotificationCenter] setDelegate:(id<UNUserNotificationCenterDelegate>) notificationCenterDelegate];
I think this must be added to the installation part of the docs, so it will be clear for the future users . https://docs.expo.io/versions/latest/sdk/notifications/#installation
Nice library by the way , thanks for your efforts!
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Hello @sjchmiela !
I tested your suggestions and it works 😃.
I think it will be a great if you included also the changes that we have to make in
AppDelegate.h
when configuring Unimodules fo iOS.Thanks !
I just want to confirm that applying the changes in the two commits (https://github.com/expo/expo/pull/10637/commits) to AppDelegate.h and AppDelegate.m fixed this iOS notification listener issue I had been having for a while!
Thanks so much for figuring it out!