react-native-zendesk-chat
react-native-zendesk-chat copied to clipboard
Application crashes on iOS (simulator) when calling ZendeskChat.startChat
Hi everyone,
I've followed the Getting Started guide:
- I've done a new
pod install
and even apod install --repo-update
.- Podfile was updated automatically.
- I've created a ZenDesk account (currently in trial).
- Obtained the
YOUR_ZENDESK_ACCOUNT_KEY
andAPP_ID_PROVIDED_BY_ZENDESK
keys. - Called
ZendeskChat.init(...)
in myindex.js
file.
But, when executing the code below in a Button
press callback, my application crashes and I have absolutely no error message:
ZendeskChat.startChat({
name: user.full_name,
email: user.email,
});
I have no idea why this is happening and have no logs at all. I do have a few questions:
- Do I need to do setup anything else from the ZenDesk iOS installation guide before going on with the Getting Started guide? Or should the auto link capabilities be enough?
Podfile.lock:
- RNZendeskChat (0.4.1):
- React-Core
- ZendeskChatSDK (~> 2.9)
- ZendeskChatProvidersSDK (2.11.2)
- ZendeskChatSDK (2.11.1):
- ZendeskChatProvidersSDK (~> 2.11.1)
- ZendeskMessagingSDK (~> 3.8.2)
- ZendeskCommonUISDK (6.1.2)
- ZendeskMessagingAPISDK (3.8.3):
- ZendeskSDKConfigurationsSDK (= 1.1.9)
- ZendeskMessagingSDK (3.8.3):
- ZendeskCommonUISDK (= 6.1.2)
- ZendeskMessagingAPISDK (= 3.8.3)
- ZendeskSDKConfigurationsSDK (1.1.9)
Environment:
- iOS: simulator.
- Dependencies:
-
"react-native": "0.64.1"
-
"react-native-zendesk-chat": "^0.4.1"
-
Experiencing the same issue even in fresh new native iOS project with minimal chat integration according to this docs
@shkatulo Out of curiosity, where did you obtain the YOUR_ZENDESK_ACCOUNT_KEY
from exactly? The screenshots posted in the documentation seems to be outdated for me and I had to look up information on how I could get such a key. Maybe, having a wrong init
call could be the issue here? But I highly doubt it.
@halftheopposite actually, for me everything looks as on screenshot:
- Open "Chat" menu pressing button on the top right (4 squares)
- Press user avatar on the top right
- Check connection
- It's shown there in modal as "Account key"
This key works for me on Android, but iOS app crashes (on device and simulator).
Thanks for you answer, I just checked with ZenDesk support and I am in an A/B test group right now, hence the slight variation in the UI and UX, but they confirmed that my account key was the correct one anyway.
@shkatulo Are you facing the issue on the iOS simulator only or also on a physical device?
@halftheopposite got it. I have the same crash on device too
@halftheopposite I fixed this issue with null-check. Please be sure that you don't pass any parameter that value is null or undefined.
For me the fix is to change phone field to use string instead of number