Closed esomkin closed 6 years ago
I had the same problem. In my case I was to add GoogleService-Info.plist to project via xcode, not just put file in project directory: https://stackoverflow.com/questions/45317777/could-not-find-a-valid-googleservice-info-plist-in-your-project#answer-45318508
@akyGit Thank you very much, application started!
I'am trying to receive push notification with
react-native-fcm
. As documentation says I'am install and implement all steps as bellowa) Install react-native-fcm
npm install react-native-fcm --save
b) Link the library withreact-native link react-native-fcm
c) DownloadGoogleService-Info.plist
file from firebase console and place it in /ios/my-project directory d) Install Firebase Messaging with Cocoapodspod 'Firebase/Messaging'
intoPodfile
pod install
e) EditAppDelegate.h
f) Edit
AppDelegate.m
-(BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions { //...
[FIRApp configure]; [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self]; return YES; }
-(void)userNotificationCenter:(UNUserNotificationCenter )center willPresentNotification:(UNNotification )notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler { [RNFIRMessaging willPresentNotification:notification withCompletionHandler:completionHandler]; }
if defined(__IPHONE_11_0)
-(void)userNotificationCenter:(UNUserNotificationCenter )center didReceiveNotificationResponse:(UNNotificationResponse )response withCompletionHandler:(void (^)(void))completionHandler { [RNFIRMessaging didReceiveNotificationResponse:response withCompletionHandler:completionHandler]; }
else
-(void)userNotificationCenter:(UNUserNotificationCenter )center didReceiveNotificationResponse:(UNNotificationResponse )response withCompletionHandler:(void(^)())completionHandler { [RNFIRMessaging didReceiveNotificationResponse:response withCompletionHandler:completionHandler]; }
endif
-(void)application:(UIApplication )application didReceiveLocalNotification:(UILocalNotification )notification { [RNFIRMessaging didReceiveLocalNotification:notification]; }
-(void)application:(UIApplication )application didReceiveRemoteNotification:(nonnull NSDictionary )userInfo fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler { [RNFIRMessaging didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler]; }