chatwoot / chatwoot-react-native-widget

React Native widget for Chatwoot
https://www.npmjs.com/package/@chatwoot/react-native-widget
MIT License
36 stars 40 forks source link

set user info not working #31

Open nusjose opened 1 year ago

nusjose commented 1 year ago

I pass user prop to ChatWootWidget, but it doesn't work. I still have to fill out the email in the form to start the conversation simulator_screenshot_4F2E0453-D93B-41AF-9601-037B0B79275B

My code

<ChatWootWidget
      websiteToken={websiteToken}
      locale={locale}
      baseUrl={baseUrl}
      closeModal={() => navigation.goBack()}
      isModalVisible={true}
      user={{
      identifier: userInfo.email,
      name: `${userInfo.name} ${userInfo.firstName}`,
      avatar_url: '',
      email: userInfo.email,
      identifier_hash: 'xGNUWSCzHdMEmDrNm9CNoiGF',
    }}
      customAttributes={customAttributes}
      colorScheme={colorScheme}

    />
desperado1802 commented 5 months ago

Hi @nusjose and anyone who is having the same issue. Most likely it is caused by the identifier_hash, if it has value causes some kind of re-render and no value is shown on ChatWoot side. Explained here: https://github.com/chatwoot/chatwoot-react-native-widget/issues/35#issuecomment-1803242934. Temporary solution for me is not assigning any value to identifier_hash . If it's a must to add it, then use customAttributes for that

praisedavid787 commented 3 weeks ago

Hi @nusjose and anyone who is having the same issue. Most likely it is caused by the identifier_hash, if it has value causes some kind of re-render and no value is shown on ChatWoot side. Explained here: #35 (comment). Temporary solution for me is not assigning any value to identifier_hash . If it's a must to add it, then use customAttributes for that

This fixed it for me 👍🏽