question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use of undeclared identifier 'FCMNotificationReceived'

See original GitHub issue

After following your installation guide (following the ‘Non Cocoapod approach’), and pasting in this code:

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))handler {
  [[NSNotificationCenter defaultCenter] postNotificationName:FCMNotificationReceived object:self userInfo:notification];
  handler(UIBackgroundFetchResultNewData);
}

I get the following error: Use of undeclared identifier 'FCMNotificationReceived'

Any idea why?

Pretty sure I added all the files the right way.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

10reactions
danyleocommented, Feb 6, 2018

@evollu actually i was following this tutorial for push notification where i got this error. http://nobrok.com/push-notification-using-react-native-and-firebase-part-3/

so for those who are following this tutorial and have this issue then replace the code

  • (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))handler { [[NSNotificationCenter defaultCenter] postNotificationName:FCMNotificationReceived object:self userInfo:notification]; handler(UIBackgroundFetchResultNewData); }

*** with this ****

(void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{ [RNFIRMessaging didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler]; }

1reaction
yusuf987commented, Apr 7, 2019

for people with zero knowledge of Objective C like me you have add an “-” before @evollu answer eg

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{
[RNFIRMessaging didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}

it took me 40 minuts to find out 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use of undeclared identifier 'RNFirebaseNotifications ...
fb login SDKs it was working fine but now starting giving these errors. My imports are like this #import "AppDelegate.h" #import <React/ ...
Read more >
Push Notification using React Native and Firebase – Part 3
Now, we need to run the application on our mobile. The first time we run, it will ask for the permission to send...
Read more >
'RCTLog.h' file not found & Us… | Apple Developer Forums
'RCTLog.h' file not found & Use of undeclared identifier 'RNBRANCH_VERSION' build-time error while creating an archive for iOS app.
Read more >
react-native-fcm-tr - npm
React Native bridge for firebase cloud messaging (FCM). Latest version: 1.1.0, last published: a year ago. Start using react-native-fcm-tr ...
Read more >
Migration/3.x problem: undeclared identifier FIRUserInfo
I've hit one snag so far: "Use of undeclared identifier FIRUserInfo". I've made sure my podfile includes auth -- I see "Using FirebaseAuth ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found