taskrabbit / react-native-zendesk-chat

React Native Wrapper around Zendesk Chat v2
MIT License
130 stars 128 forks source link

Fatal Exception: NSInvalidArgumentException #108

Open ArtemVass opened 3 years ago

ArtemVass commented 3 years ago

*** -[NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0] 33-[RNZendeskChatModule startChat:]_block_invoke

RNZendeskChatModule.m - Line 158 __33-[RNZendeskChatModule startChat:]_block_invoke + 158

iOS 14.4.0 (18D52) iOS 13.4.0 (17E8255) iOS 14.5.0 (18E5164h)

fbartho commented 3 years ago

Please paste your .startChat call from JS?

fbartho commented 3 years ago

It’s crashing, because ZDKChatEngine is throwing an error, and we’re unfortunately swallowing it.

You can see what error if you manually change this line: https://github.com/taskrabbit/react-native-zendesk-chat/blob/799c8d25fdff5a81b9ee787b14e4b1cc7b4c68df/ios/RNZendeskChatModule.m#L159

- [ZDKChatEngine engineAndReturnError:&error]
+ [ZDKChatEngine engineAndReturnError:&error] ?: NSNull.null

This change will give you a better error log about the true problem

rnike commented 3 years ago

@fbartho I got this after applying the code

[RNZendeskChatModule] Internal Error loading ZDKChatEngine ChatProvidersSDK.ChatError
rnike commented 3 years ago

okay I know why it fails, I haven't init before startChat