Cordova-plugin-firebase: [FirebasePlugin messaging:didRefreshRegistrationToken:]: unrecognized selector sent to instance

Created on 24 Oct 2017  Â·  20Comments  Â·  Source: arnesson/cordova-plugin-firebase

Getting this error when attempting to call unregister().

Most helpful comment

Hi,
I've got the same error when I call it on logout:
-[FirebasePlugin messaging:didRefreshRegistrationToken:]: unrecognized selector sent to instance 0x604001267680 2017-10-26 13:44:32.241317+0200 AppName...[19555:5069046] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FirebasePlugin messaging:didRefreshRegistrationToken:]: unrecognized selector sent to instance 0x604001267680'

Test on iOS 11

All 20 comments

Hi,
I've got the same error when I call it on logout:
-[FirebasePlugin messaging:didRefreshRegistrationToken:]: unrecognized selector sent to instance 0x604001267680 2017-10-26 13:44:32.241317+0200 AppName...[19555:5069046] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FirebasePlugin messaging:didRefreshRegistrationToken:]: unrecognized selector sent to instance 0x604001267680'

Test on iOS 11

Hi, i have the same problem. Any progress on this?

Hi,
No progress for moment. In another plugin, it seems to be similar problem : https://github.com/fechanique/cordova-plugin-fcm/issues/344

Maybe in the FirebasePlugin.m, lines 120 and 129, similar change could resolve:
[[FIRMessaging messaging] setRemoteMessageDelegate:self]
become
[[FIRMessaging messaging] setDelegate:self];

i made a fork with the change, reinstall the plugin. It's work on iOS 11 and iOS 9.3.5.

hmm this didn't work for me when doing a clean install on ios11. I would still receive the error. Relaunching the app worked but clean install didn't. Rolling back to 1.24 fixed it.

@shi11 Had the same issue and I can confirm - downgrading to 0.1.24 solves it

closing for now, reopen if still an issue with the latest version of the plugin

Hi, I'm getting this error too:

NSInvalidArgumentException: -[FirebasePlugin messaging:didRefreshRegistrationToken:]: unrecognized selector sent to instance 0x1c4c6fb80

Devices:

iPad 2017 (6,11)
2, 28 %
iPhone 7 (9,3)
1, 14 %
iPad Pro (6,7)
1, 14 %
Iphone 6s Plus
1, 14%
Iphone 6s (8,1)
1, 14%
Iphone 8 Plus
1, 14%

IOS:

11.2.6
6, 85 %
11.2.5
1, 14 %

Plugin version:
cordova-plugin-firebase: 0.1.25

Hope you can help me

I have the same error

Hi, im facing the same errors. They seems not only bound to unregister() , they also happens on Push permisson prompt or after allow it. But its also unreliable to reproduce.

NSInvalidArgumentException: -[FirebasePlugin messaging:didRefreshRegistrationToken:]: unrecognized selector sent to instance 0x1d5660280
1
CoreFoundation
__exceptionPreprocess + 1323364
2
libobjc.A.dylib
objc_exception_throw + 34084
3
CoreFoundation
-[NSObject(NSObject) doesNotRecognizeSelector:] + 1377828
4
CoreFoundation
___forwarding___ + 1346316
5
CoreFoundation
_CF_forwarding_prep_0 + 187592
6
Base-Chat
4337202352 + 3421360
7
CoreFoundation
__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 872760
8
CoreFoundation
_CFXRegistrationPost + 870104
9
CoreFoundation
___CFXNotificationPost_block_invoke + 869436
10
CoreFoundation
-[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1383968
11
CoreFoundation
_CFXNotificationPost + 44380
12
Foundation
postQueueNotifications + 377868
13
CoreFoundation
__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 961752
14
CoreFoundation
__CFRunLoopDoObservers + 951952
15
CoreFoundation
__CFRunLoopRun + 953124
16
CoreFoundation
CFRunLoopRunSpecific + 35924
17
GraphicsServices
GSEventRunModal + 44928
18
UIKit
UIApplicationMain + 472512
19
Base-Chat
4333804080 + 23088
20
libdyld.dylib
start + 5480

Plugin version:
cordova-plugin-firebase: 0.1.25

best regards

The exact same error here @ColDrekken :

NSInvalidArgumentException: -[FirebasePlugin messaging:didRefreshRegistrationToken:]: unrecognized selector sent to instance 0x1c0275d40
1
CoreFoundation
__exceptionPreprocess + 1323364
2
libobjc.A.dylib
objc_exception_throw + 34084
3
CoreFoundation
-[NSObject(NSObject) doesNotRecognizeSelector:] + 1377828
4
CoreFoundation
___forwarding___ + 1346316
5
CoreFoundation
_CF_forwarding_prep_0 + 187592
6
App-Name
4364732468 + 1099828
7
CoreFoundation
__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 872760
8
CoreFoundation
_CFXRegistrationPost + 870104
9
CoreFoundation
___CFXNotificationPost_block_invoke + 869436
10
CoreFoundation
-[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1383968
11
CoreFoundation
_CFXNotificationPost + 44380
12
Foundation
postQueueNotifications + 377868
13
CoreFoundation
__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 961752
14
CoreFoundation
__CFRunLoopDoObservers + 951952
15
CoreFoundation
__CFRunLoopRun + 953124
16
CoreFoundation
CFRunLoopRunSpecific + 35924
17
GraphicsServices
GSEventRunModal + 44928
18
UIKit
UIApplicationMain + 472512
19
App-Name
4363650528 + 17888
20
libdyld.dylib
start + 5480

Any news? @robertarnesson Can you re-open this issue, please.

Same Problem

same

same
2018-03-25 19:07:29.799784-0600 The Todos Santos Smart App[1454:415575] -[__NSCFString objectForKeyedSubscript:]: unrecognized selector sent to instance 0x1016704a0
2018-03-25 19:07:29.804616-0600 The Todos Santos Smart App[1454:415575] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString objectForKeyedSubscript:]: unrecognized selector sent to instance 0x1016704a0'
*
First throw call stack:
(0x1828af164 0x181af8528 0x1828bc628 0x1828b4b10 0x182799ccc 0x100dc0870 0x100dadac0 0x100dad97c 0x100dad8e0 0x100d624f8 0x100e122d8 0x100d36fd8 0x100d36e3c 0x100d387f0 0x191d2aefc 0x191cbf4b0 0x191cc15d8 0x191aa6e64 0x191c88880 0x191a66694 0x191a690a4 0x189c04984 0x189c04c44 0x18285777c 0x1828576fc 0x182856f84 0x182854b5c 0x182774c58 0x184620f84 0x18becd5c4 0x100d26758 0x18229456c)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

same problem here, any workaround?

Same problem for me. Version 0.1.25. Seems to happen with grantPermission().

Anyone have a fix?

Same issue for me as well.
Cloned master and implemented the method messaging:didRefreshRegistrationToken in AppDelegate+FirebasePlugin.m but still got the same error.

Lol, it's a problem for me as well. Crash on logout, with this error the most helpful thing in the call stack.

for those who are stuck on cordova plugins, consider migrating to capacitor.

I built a plugin to handle fcm, if anyone is interested

https://github.com/stewwan/capacitor-fcm

We had an issue with our watchers not unsubscribing on user logout, and so we had massive permissions errors. Fixing that seemed to do the trick. Still not sure exactly how, but I think it might have to do with hefty firestore access sans permission.

¯\_(ツ)_/¯

Was this page helpful?
0 / 5 - 0 ratings