Skip to content

Instantly share code, notes, and snippets.

@katharinepadilha
Created August 8, 2019 00:25
Show Gist options
  • Save katharinepadilha/094faea08c4e198fcff26d9997cfab7a to your computer and use it in GitHub Desktop.
Save katharinepadilha/094faea08c4e198fcff26d9997cfab7a to your computer and use it in GitHub Desktop.
AppDelegate to firebase setup
#import <Firebase.h>
#import "RNFirebaseNotifications.h"
#import "RNFirebaseMessaging.h"
//...
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//...
[FIRApp configure];
[RNFirebaseNotifications configure];
//...
}
//...
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
[[RNFirebaseNotifications instance] didReceiveLocalNotification:notification];
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo
fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{
[[RNFirebaseNotifications instance] didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
[[RNFirebaseMessaging instance] didRegisterUserNotificationSettings:notificationSettings];
}
//...
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment