evollu / react-native-fcm

react native module for firebase cloud messaging and local notification
MIT License
1.73k stars 681 forks source link

Use of undeclared identifier 'FCMNotificationReceived' #760

Open ayushiSharma22 opened 6 years ago

ayushiSharma22 commented 6 years ago

Below is my code. I'm Receiving the error "Use of undeclared identifier 'FCMNotificationReceived'" on the lines marked in Bold. /**

import "AppDelegate.h"

import <CodePush/CodePush.h>

import "RCTBundleURLProvider.h"

import "RCTRootView.h"

@import Firebase;

import "RNFIRMessaging.h"

@implementation AppDelegate

ifdef DEBUG

jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];

else

jsCodeLocation = [CodePush bundleURL];

endif

RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName:@"seller_app" initialProperties:nil launchOptions:launchOptions]; rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; UIViewController *rootViewController = [UIViewController new]; rootViewController.view = rootView; self.window.rootViewController = rootViewController; [self.window makeKeyAndVisible]; [FIRApp configure];

if defined(IPHONE_10_0) && IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0

[[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];

endif

return YES; }

if defined(IPHONE_10_0) && IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0

else

-(void)application:(UIApplication )application didReceiveLocalNotification:(UILocalNotification )notification { [[NSNotificationCenter defaultCenter] postNotificationName:FCMNotificationReceived object:self + userInfo:notification.userInfo]; }

endif

[[NSNotificationCenter defaultCenter] postNotificationName:FCMNotificationReceived object:self userInfo:userInfo];

_ completionHandler(UIBackgroundFetchResultNoData); } @end

RN version : 0.52.1 react-native-fcm version : ^11.3.1 Using xcode App is not running?

evollu commented 6 years ago

try remove DerivedData and rebuild? Also in build schema, try turn off parallel build

siemya commented 6 years ago

@evollu i am facing the same problem, tried your solution, no help.

evollu commented 6 years ago

this error happens mostly because of link issue. check the different between example app

RameshkrishnanV commented 6 years ago

Same issue