From cb1cc782842e6174ab1d0fd4e7882087c52d2dda Mon Sep 17 00:00:00 2001 From: ShridharGoel <35566748+ShridharGoel@users.noreply.github.com> Date: Tue, 2 Apr 2024 20:12:54 +0530 Subject: [PATCH 1/2] Hide notification badge on iOS app reinstall --- ios/NewExpensify/AppDelegate.mm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ios/NewExpensify/AppDelegate.mm b/ios/NewExpensify/AppDelegate.mm index f5ddba46f5f1..30ea7e6d291e 100644 --- a/ios/NewExpensify/AppDelegate.mm +++ b/ios/NewExpensify/AppDelegate.mm @@ -22,7 +22,7 @@ - (BOOL)application:(UIApplication *)application // You can add your custom initial props in the dictionary below. // They will be passed down to the ViewController used by React Native. self.initialProps = @{}; - + // Configure firebase [FIRApp configure]; @@ -34,7 +34,7 @@ - (BOOL)application:(UIApplication *)application [RCTBootSplash initWithStoryboard:@"BootSplash" rootView:(RCTRootView *)self.window.rootViewController.view]; // <- initialization using the storyboard file name - + // Define UNUserNotificationCenter UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter]; @@ -44,7 +44,12 @@ - (BOOL)application:(UIApplication *)application // stopped by a native module in the JS so we can measure total time starting // in the native layer and ending in the JS layer. [RCTStartupTimer start]; - + + if (![[NSUserDefaults standardUserDefaults] boolForKey:@"isFirstRunComplete"]) { + [UIApplication sharedApplication].applicationIconBadgeNumber = 0; + [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"isFirstRunComplete"]; + } + return YES; } From 9e775d5bffad543e230ad3266fe166aa7376ef6c Mon Sep 17 00:00:00 2001 From: Shridhar Goel <35566748+ShridharGoel@users.noreply.github.com> Date: Wed, 3 Apr 2024 12:04:57 +0530 Subject: [PATCH 2/2] Update AppDelegate.mm --- ios/NewExpensify/AppDelegate.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/NewExpensify/AppDelegate.mm b/ios/NewExpensify/AppDelegate.mm index 30ea7e6d291e..f4f7f3bc8dbc 100644 --- a/ios/NewExpensify/AppDelegate.mm +++ b/ios/NewExpensify/AppDelegate.mm @@ -22,7 +22,7 @@ - (BOOL)application:(UIApplication *)application // You can add your custom initial props in the dictionary below. // They will be passed down to the ViewController used by React Native. self.initialProps = @{}; - + // Configure firebase [FIRApp configure]; @@ -34,7 +34,7 @@ - (BOOL)application:(UIApplication *)application [RCTBootSplash initWithStoryboard:@"BootSplash" rootView:(RCTRootView *)self.window.rootViewController.view]; // <- initialization using the storyboard file name - + // Define UNUserNotificationCenter UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];