Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

[FIRA_AppDelegate- messaging:didRefreshRegistrationToken:]: unrecognized selector sent to instance - firebase crash issue

I found a new issue when I reinstalled the iOS app. Before reinstalling the app worked fine. Before reinstalling I updated cocoa sdk repo and it updated Firebase and FirebaseDatabase version from 3.15.0 to version 4.0.0.

Here is the crash log below:

-[FIRA_AppDelegate-1495465837867 messaging:didRefreshRegistrationToken:]: unrecognized selector sent to instance 0x174661b40 2017-05-22 23:10:58.550969+0800 moodfriends[1716:245390] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FIRA_AppDelegate-1495465837867 messaging:didRefreshRegistrationToken:]: unrecognized selector sent to instance 0x174661b40'

like image 618
Danny Avatar asked Nov 21 '25 09:11

Danny


2 Answers

Just found the solution.

Changed

[FIRMessaging messaging].remoteMessageDelegate = self;

to

[FIRMessaging messaging].delegate = self;

It seems remoteMessageDelegate is deprecated with the version update and should FIRMessagingDelegate delegate functions.

Swift 3:

Messaging.messaging().delegate = self
like image 188
Danny Avatar answered Nov 23 '25 23:11

Danny


the crash occurred because either the class has no declaration of method messaging:didRefreshRegistrationToken:

or you didn't have set delegate for Firebase Message

like image 33
vivek bhoraniya Avatar answered Nov 23 '25 23:11

vivek bhoraniya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!