From 7f408bd79187a5efd512f3d8dc203ebb15dde9f6 Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Fri, 23 Jul 2021 08:04:40 -0700 Subject: Add package to set badge icon, Reset badge icon --- src/screens/main/NotificationsScreen.tsx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/screens/main/NotificationsScreen.tsx b/src/screens/main/NotificationsScreen.tsx index 84c15f66..b19107a7 100644 --- a/src/screens/main/NotificationsScreen.tsx +++ b/src/screens/main/NotificationsScreen.tsx @@ -29,6 +29,7 @@ import { import {RootState} from '../../store/rootReducer'; import {NotificationType, ScreenType} from '../../types'; import {getDateAge, normalize, SCREEN_HEIGHT, SCREEN_WIDTH} from '../../utils'; +import PushNotificationIOS from '@react-native-community/push-notification-ios'; const NotificationsScreen: React.FC = () => { const {newNotificationReceived} = useSelector( @@ -111,6 +112,7 @@ const NotificationsScreen: React.FC = () => { : moment(previousLastViewed), ); await AsyncStorage.setItem(key, moment().toString()); + PushNotificationIOS.setApplicationIconBadgeNumber(0); }; getAndUpdateLastViewed(); }, [notifications]); -- cgit v1.2.3-70-g09d2