diff options
author | Shravya Ramesh <37447613+shravyaramesh@users.noreply.github.com> | 2020-12-29 11:41:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-29 14:41:57 -0500 |
commit | 05cd91206a6ce3361097d9eb408a447eae3d120e (patch) | |
tree | 1b8c5ba82358c3f9b393ea42d03b6c9c7219ce7f /ios/Frontend/AppDelegate.m | |
parent | efaa41884b5aa4b4704380eb3615d3801958a775 (diff) |
[TMA-288] notifications frontend infra (#154)
* Configured settings to enable remote notifications
* Added FCM services
* Added background message handler + api calls
* minor fixes
* minor changes requested from pr
Diffstat (limited to 'ios/Frontend/AppDelegate.m')
-rw-r--r-- | ios/Frontend/AppDelegate.m | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ios/Frontend/AppDelegate.m b/ios/Frontend/AppDelegate.m index 31f06642..2b52605f 100644 --- a/ios/Frontend/AppDelegate.m +++ b/ios/Frontend/AppDelegate.m @@ -4,6 +4,7 @@ #import <React/RCTBundleURLProvider.h> #import <React/RCTRootView.h> #import "RNSplashScreen.h" +#import <Firebase.h> #if DEBUG #import <FlipperKit/FlipperClient.h> @@ -26,12 +27,23 @@ static void InitializeFlipper(UIApplication *application) { @implementation AppDelegate +- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo + fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { + // If you are receiving a notification message while your app is in the background, + // this callback will not be fired till the user taps on the notification launching the application. + + completionHandler(UIBackgroundFetchResultNewData); +} + - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { #if DEBUG InitializeFlipper(application); #endif + if ([FIRApp defaultApp] == nil) { + [FIRApp configure]; + } RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"Frontend" |