walterholohan / react-native-crisp-chat-sdk

React-Native bridge for Crisp Chat iOS and Android SDK's
MIT License
71 stars 26 forks source link

The chat could not launch #121

Closed sylainx closed 6 months ago

sylainx commented 6 months ago

I can't use the library with an expo dev-client

Can you please help me ?

const CrispChatContainer: React.FC<chatContainer> = ({ style }) => {
  // hooks
  const { user } = useManageUser();

  // states

  configure(process?.env?.EXPO_PUBLIC_CRISP_WEBSITE_ID ?? "");
  // this should be user ID that way app will load previous user chats
  setTokenId(user?.user_id);

  // Set user's info
  setUserAvatar(user?.avatar ?? "");
  setUserEmail(user?.email ?? "");
  setUserNickname(user?.username);
  setUserPhone(user?.phone);

  // Call session reset when user loggs out
  // resetSession();

  return <CrispChat />;
};

After run npx expo-env-info

 expo-env-info 1.2.0 environment info:
    System:
      OS: macOS 12.7.3
      Shell: 3.2.57 - /bin/sh
    Binaries:
      Yarn: 1.22.19 - /usr/local/bin/yarn
      npm: 10.2.4 - ~/Library/Application Support/Herd/config/nvm/versions/node/v18.19.1/bin/npm
    IDEs:
      Android Studio: 2023.1 AI-231.9392.1.2311.11330709
      Xcode: /undefined - /usr/bin/xcodebuild
    npmPackages:
      expo: ~50.0.13 => 50.0.13 
      react: 18.2.0 => 18.2.0 
      react-dom: 18.2.0 => 18.2.0 
      react-native: 0.73.4 => 0.73.4 
      react-native-web: ~0.19.6 => 0.19.10 
    npmGlobalPackages:
      eas-cli: 7.5.0
    Expo Workflow: managed
And `npx expo-doctor@latest`
Detailed check results:

Expected package @expo/config-plugins@~7.8.0
Found invalid:
  @expo/config-plugins@4.1.5
  @expo/config-plugins@7.2.5
  (for more info, run: npm why @expo/config-plugins)
Expected package @expo/prebuild-config@~6.7.0
Found invalid:
  @expo/prebuild-config@6.2.6
  (for more info, run: npm why @expo/prebuild-config)
Expected package metro@~0.80.4
Found invalid:
  metro@0.76.9
  (for more info, run: npm why metro)
Expected package metro-resolver@~0.80.4
Found invalid:
  metro-resolver@0.76.9
  (for more info, run: npm why metro-resolver)
Expected package metro-config@~0.80.4
Found invalid:
  metro-config@0.76.9
  (for more info, run: npm why metro-config)
Advice: Upgrade dependencies that are using the invalid package versions and remove resolutions from package.json that are pinning metro and metro-resolver to an invalid version.

The following packages should be updated for best compatibility with the installed expo version:
  @expo/prebuild-config@6.2.6 - expected version: ~6.7.0
  expo@50.0.13 - expected version: ~50.0.14
  expo-dev-client@3.3.10 - expected version: ~3.3.11
  react-native@0.73.4 - expected version: 0.73.6
Your project may not work correctly until you install the correct versions of the packages.
Found outdated dependencies
Advice: Use 'npx expo install --check' to review and upgrade your dependencies.
baptistejamin commented 6 months ago

Do you have a screenshot?

sylainx commented 6 months ago

crisp_chat_cant_launch

sylainx commented 6 months ago

I solved the problem

I had locked the chatbox to the site's domain (and subdomains).

Settings > Site settings > Chatbox & Emails settings > Chatbox security