react-native-zendesk-chat icon indicating copy to clipboard operation
react-native-zendesk-chat copied to clipboard

Application crashes on iOS (simulator) when calling ZendeskChat.startChat

Open halftheopposite opened this issue 3 years ago • 7 comments

Hi everyone,

I've followed the Getting Started guide:

  • I've done a new pod install and even a pod install --repo-update.
    • Podfile was updated automatically.
  • I've created a ZenDesk account (currently in trial).
  • Obtained the YOUR_ZENDESK_ACCOUNT_KEY and APP_ID_PROVIDED_BY_ZENDESK keys.
  • Called ZendeskChat.init(...) in my index.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"

halftheopposite avatar Feb 22 '22 13:02 halftheopposite

Experiencing the same issue even in fresh new native iOS project with minimal chat integration according to this docs

shkatulo avatar Feb 22 '22 13:02 shkatulo

@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 avatar Feb 22 '22 13:02 halftheopposite

@halftheopposite actually, for me everything looks as on screenshot:

  1. Open "Chat" menu pressing button on the top right (4 squares)
  2. Press user avatar on the top right
  3. Check connection
  4. It's shown there in modal as "Account key"

This key works for me on Android, but iOS app crashes (on device and simulator).

shkatulo avatar Feb 22 '22 13:02 shkatulo

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 avatar Feb 22 '22 14:02 halftheopposite

@halftheopposite got it. I have the same crash on device too

shkatulo avatar Feb 22 '22 14:02 shkatulo

@halftheopposite I fixed this issue with null-check. Please be sure that you don't pass any parameter that value is null or undefined.

kanadikirik avatar May 09 '22 06:05 kanadikirik

For me the fix is to change phone field to use string instead of number

SimajjiHans avatar Oct 17 '22 02:10 SimajjiHans