Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ios notifications: Update the badge count if the app is foregrounded.
This is based on the recommended setup for PushNotificationIOS from React Native [1], so we might have included it in the next commit, where we fully set that up. But as Greg points out [2], this code is purely using upstream iOS APIs, so it doesn't depend on whether we're using that RN module or something else, so it's fine to do here on its own. In a departure from those instructions, we decide to just pass the thing (`UNNotificationPresentationOptionBadge`) that updates the badge count when the app is foregrounded. This is a necessary part of zulip#4182, but one thing we'll still need to do for that is test that the server is sending the right badge counts to the client. [1] https://reactnative.dev/docs/0.62/pushnotificationios. These instructions are actually missing a required change to the AppDelegate.h, which we take here, having seen it in the instructions for @react-native-community/push-notification-ios (at https://github.com/react-native-push-notification-ios/push-notification-ios#update-appdelegateh). [2] zulip#4163 (comment)
- Loading branch information