aboutsummaryrefslogtreecommitdiff
path: root/ios/Frontend
diff options
context:
space:
mode:
authorShravya Ramesh <37447613+shravyaramesh@users.noreply.github.com>2020-12-29 11:41:57 -0800
committerGitHub <noreply@github.com>2020-12-29 14:41:57 -0500
commit05cd91206a6ce3361097d9eb408a447eae3d120e (patch)
tree1b8c5ba82358c3f9b393ea42d03b6c9c7219ce7f /ios/Frontend
parentefaa41884b5aa4b4704380eb3615d3801958a775 (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')
-rw-r--r--ios/Frontend/AppDelegate.m12
-rw-r--r--ios/Frontend/FrontendDebug.entitlements8
-rw-r--r--ios/Frontend/Info.plist4
3 files changed, 24 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"
diff --git a/ios/Frontend/FrontendDebug.entitlements b/ios/Frontend/FrontendDebug.entitlements
new file mode 100644
index 00000000..903def2a
--- /dev/null
+++ b/ios/Frontend/FrontendDebug.entitlements
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>aps-environment</key>
+ <string>development</string>
+</dict>
+</plist>
diff --git a/ios/Frontend/Info.plist b/ios/Frontend/Info.plist
index ebd7ab42..0f036f56 100644
--- a/ios/Frontend/Info.plist
+++ b/ios/Frontend/Info.plist
@@ -58,6 +58,10 @@
<array>
<string>Feather.ttf</string>
</array>
+ <key>UIBackgroundModes</key>
+ <array>
+ <string>remote-notification</string>
+ </array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>