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.

FCM.setBadgeNumber() crashes app iOS

See original GitHub issue

Hi, I am trying to use FCM.setBadgeNumber(0); but it crashes the app in both iOS device and simulator. It is giving me an error in ios/RNFIRMessaging.m RCT_EXPORT_METHOD(setBadgeNumber:_ (NSInteger*) number) { [RCTSharedApplication() setApplicationIconBadgeNumber:*number]; // <---- crashes (line 389) }

react-native-fcm 7.0.0 RN 0.44.0 React 16.0.0-alpha.6 iOS 10.2

Thanks in advance for any help.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
cmedinasoriano1commented, Jun 9, 2017

Thanks for that but I also found a workaround…

RCT_EXPORT_METHOD(setBadgeNumber: (NSInteger*) number)
{
  RCTSharedApplication().applicationIconBadgeNumber = number;
}

But I am also not sure this is the best solution.

0reactions
cmedinasoriano1commented, Jun 9, 2017

Thanks for that! Then I think I will stay with that one… I should close this issue then, thanks everyone!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

iOS app crashes when subscribing hundred of topics on ...
I use FCM to handle notifications in my iOS app. All works fine, but I have encountered problems when I have to handle...
Read more >
IOS 10 crashes caused by Local Notification - Apple Developer
So I can have up to 60 notifications defined. When the app is opened or when a new contact is added through the...
Read more >
Firebase Crashlytics
Get clear, actionable insight into app issues with this powerful crash reporting solution for Apple, Android, Flutter, and Unity.
Read more >
Firebase Messaging is causing a crash on Xamarin iOS
I'm using VS 2019 ver.16.9.2 and Xamarin Forms 5.0.0.2012. My iOS app works well on physical devices, but when I install the Xamarin....
Read more >
Flutter Crash on register for Push Notifications - General
An app with the following code and the same dependencies crashes on startup. void main() async { WidgetsFlutterBinding.ensureInitialized(); ...
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