Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am unable to get notification, when app is in open state or background. please give solution. #1136

Open
Jeet007das opened this issue Jun 28, 2020 · 1 comment

Comments

@Jeet007das
Copy link

Before openning an issue

  1. Reproduce it with the example project in this repo.
  2. If you can't receive iOS notification, make sure you can receive notification using quickstart-ios project provided by Firebase team

When openning an issue, please include following information for better support

  1. What version of RN and react-native-fcm are you running?
  2. What device are you using? (e.g iOS9 emulator, Android 6 device)?
  3. Is your app running in foreground, background or not running?
@Jeet007das Jeet007das changed the title I am unable to get notification, when app is in open state or background. I am unable to get notification, when app is in open state or background. please give solution. Jun 28, 2020
@ersenkaya
Copy link

use try/catch in finishNotificationResponse Method,

node_modules -> react-native-fcm->RNFIRMessagging.m

RCT_EXPORT_METHOD(finishNotificationResponse: (NSString *)completionHandlerId){
RCTNotificationResponseCallback completionHandler = self.notificationCallbacks[completionHandlerId];
if (!completionHandler) {
@Try {
RCTLogError(@"There is no completion handler with completionHandlerId: %@", completionHandlerId);
return;
}
@catch (NSException * e) {
NSLog(@"Exception completionHandler: %@", e);
}

} else {
    @try {
        completionHandler();
        [self.notificationCallbacks removeObjectForKey:completionHandlerId];
    }
    @catch (NSException * e) {
        NSLog(@"Exception completionHandler: %@", e);
    }
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants