React-native-navigation: [v2][iOS] Unable to push ViewController from Native code

Created on 2 May 2019  ·  11Comments  ·  Source: wix/react-native-navigation

Issue Description

I'm trying to integrate Frechchat SDK to React Native. Its simply a chat UI SDK. It pushes a UIViewController from native code over the React Native app. Since the last RNN update, I have gotten the following error when trying to invoke a method to display the UI.

Any ideas?

Steps to Reproduce / Code Snippets / Screenshots

2019-05-01 23:59:56.240855-0700 MyApp[76069:2329763] -[ConversationOptions mergeInOptions:]: unrecognized selector sent to instance 0x600002902200
2019-05-01 23:59:56.276 [fatal][tid:main] Exception '-[ConversationOptions mergeInOptions:]: unrecognized selector sent to instance 0x600002902200' was thrown while invoking showConversations on target RNFreshchatSdk with params (
)
callstack: (
    0   CoreFoundation                      0x000000011376d6fb __exceptionPreprocess + 331
    1   libobjc.A.dylib                     0x00000001124ebac5 objc_exception_throw + 48
    2   CoreFoundation                      0x000000011378bab4 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
    3   CoreFoundation                      0x0000000113772443 ___forwarding___ + 1443
    4   CoreFoundation                      0x0000000113774238 _CF_forwarding_prep_0 + 120
    5   MyApp                               0x000000010d8ac8b5 -[UIViewController(LayoutProtocol) resolveOptions] + 149
    6   MyApp                               0x000000010d8ad43e -[UIViewController(LayoutProtocol) willMoveToParentViewController:] + 110
    7   UIKitCore                           0x000000011efdeda6 -[UIViewController _addChildViewController:performHierarchyCheck:notifyWillMove:] + 614
    8   UIKitCore                           0x000000011ef421ba -[UINavigationController pushViewController:transition:forceImmediate:] + 1136
    9   UIKitCore                           0x000000011ef41bac -[UINavigationController pushViewController:animated:] + 681
    10  UIKitCore                           0x000000011ef2261d -[UINavigationController initWithRootViewController:] + 123
    11  MyApp                               0x000000010d7123bb +[FCControllerUtils presentOn:option:] + 141
    12  MyApp                               0x000000010d794cd2 -[Freshchat showConversations:withOptions:] + 227
    13  MyApp                               0x000000010d794a85 -[Freshchat showConversations:] + 133
    14  MyApp                               0x000000010dee43f4 -[RNFreshchatSdk showConversations] + 196
    15  CoreFoundation                      0x00000001137744cc __invoking___ + 140
    16  CoreFoundation                      0x0000000113771a45 -[NSInvocation invoke] + 325
    17  CoreFoundation                      0x0000000113771e96 -[NSInvocation invokeWithTarget:] + 54
    18  MyApp                               0x000000010d9eb96a -[RCTModuleMethod invokeWithBridge:module:arguments:] + 2810
    19  MyApp                               0x000000010da88776 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 790
    20  MyApp                               0x000000010da88283 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 131
    21  MyApp                               0x000000010da881f9 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 25
    22  libdispatch.dylib                   0x00000001182c5d7f _dispatch_call_block_and_release + 12
    23  libdispatch.dylib                   0x00000001182c6db5 _dispatch_client_callout + 8
    24  libdispatch.dylib                   0x00000001182d4080 _dispatch_main_queue_callback_4CF + 1540
    25  CoreFoundation                      0x00000001136d48a9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    26  CoreFoundation                      0x00000001136cef56 __CFRunLoopRun + 2310
    27  CoreFoundation                      0x00000001136ce302 CFRunLoopRunSpecific + 626
    28  GraphicsServices                    0x0000000117ecc2fe GSEventRunModal + 65
    29  UIKitCore                           0x000000011f5dcba2 UIApplicationMain + 140
    30  MyApp                               0x000000010d6f5d60 main + 112
    31  libdyld.dylib                       0x000000011833b541 start + 1
)
2019-05-01 23:59:56.276610-0700 MyApp[76069:2329763] Exception '-[ConversationOptions mergeInOptions:]: unrecognized selector sent to instance 0x600002902200' was thrown while invoking showConversations on target RNFreshchatSdk with params (
)
callstack: (
    0   CoreFoundation                      0x000000011376d6fb __exceptionPreprocess + 331
    1   libobjc.A.dylib                     0x00000001124ebac5 objc_exception_throw + 48
    2   CoreFoundation                      0x000000011378bab4 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
    3   CoreFoundation                      0x0000000113772443 ___forwarding___ + 1443
    4   CoreFoundation                      0x0000000113774238 _CF_forwarding_prep_0 + 120
    5   MyApp                               0x000000010d8ac8b5 -[UIViewController(LayoutProtocol) resolveOptions] + 149
    6   MyApp                               0x000000010d8ad43e -[UIViewController(LayoutProtocol) willMoveToParentViewController:] + 110
    7   UIKitCore                           0x000000011efdeda6 -[UIViewController _addChildViewController:performHierarchyCheck:notifyWillMove:] + 614
    8   UIKitCore                           0x000000011ef421ba -[UINavigationController pushViewController:transition:forceImmediate:] + 1136
    9   UIKitCore                           0x000000011ef41bac -[UINavigationController pushViewController:animated:] + 681
    10  UIKitCore                           0x000000011ef2261d -[UINavigationController initWithRootViewController:] + 123
    11  MyApp                               0x000000010d7123bb +[FCControllerUtils presentOn:option:] + 141
    12  MyApp                               0x000000010d794cd2 -[Freshchat showConversations:withOptions:] + 227
    13  MyApp                               0x000000010d794a85 -[Freshchat showConversations:] + 133
    14  MyApp                               0x000000010dee43f4 -[RNFreshchatSdk showConversations] + 196
    15  CoreFoundation                      0x00000001137744cc __invoking___ + 140
    16  CoreFoundation                      0x0000000113771a45 -[NSInvocation invoke] + 325
    17  CoreFoundation                      0x0000000113771e96 -[NSInvocation invokeWithTarget:] + 54
    18  MyApp                               0x000000010d9eb96a -[RCTModuleMethod invokeWithBridge:module:arguments:] + 2810
    19  MyApp                               0x000000010da88776 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 790
    20  MyApp                               0x000000010da88283 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 131
    21  MyApp                               0x000000010da881f9 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 25
    22  libdispatch.dylib                   0x00000001182c5d7f _dispatch_call_block_and_release + 12
    23  libdispatch.dylib                   0x00000001182c6db5 _dispatch_client_callout + 8
    24  libdispatch.dylib                   0x00000001182d4080 _dispatch_main_queue_callback_4CF + 1540
    25  CoreFoundation                      0x00000001136d48a9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    26  CoreFoundation                      0x00000001136cef56 __CFRunLoopRun + 2310
    27  CoreFoundation                      0x00000001136ce302 CFRunLoopRunSpecific + 626
    28  GraphicsServices                    0x0000000117ecc2fe GSEventRunModal + 65
    29  UIKitCore                           0x000000011f5dcba2 UIApplicationMain + 140
    30  MyApp                               0x000000010d6f5d60 main + 112
    31  libdyld.dylib                       0x000000011833b541 start + 1
)


Environment

  • React Native Navigation version: 2.18.4
  • React Native version: 0.59.3
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): Both, all.
🏚 stale

Most helpful comment

I can confirm it works on RNN 2.16.0, but broken after...

All 11 comments

I can confirm it works on RNN 2.16.0, but broken after...

same for me

How were you able to push it previously from a react screen to native? I don't see any documentation for this. Can I see your code snippet to get an idea?

`2019-05-10 11:26:10.850405+0700 ProjectName[326:25128] -[ConversationOptions mergeInOptions:]: unrecognized selector sent to instance 0x282141e00

2019-05-10 11:26:10.851029+0700 ProjectName[326:25128] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ConversationOptions mergeInOptions:]: unrecognized selector sent to instance 0x282141e00'`

Hi i also got the same issue as @bensont1 does anyone here knows at least how to temporarily fix this issue, other than downgrading the RNN version if possible?

I have the same issue with instabug on feature request

RNN 2.16.0 works fine though

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

This issue is still happening in 2.22.3. Are there any workarounds or plans to fix it anytime soon?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.

The issue has been closed for inactivity.

this is still an issue in 3.1.1
I believe the bug was introduced in #4947

Yep issue still exists in 3.1.X, with RN 0.60.5.
Have not found a workaround for this.

I have tried the following but still get the same unrecognized selector error.

  1. Get the presented view controller using:
RCTPresentedViewController();
  1. Get the ViewController using RNN, where "appMain" is the componentId in JS code:
UIViewController *visibleVC = [ReactNativeNavigation findViewController:@"appMain"];
Was this page helpful?
0 / 5 - 0 ratings