How to use react-native-intercom - 10 common examples

To help you get started, we’ve selected a few react-native-intercom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pillarwallet / pillarwallet / src / actions / authActions.js View on Github external
wallet = { ...encryptedWallet, privateKey, address: walletAddress };
      } else {
        // nothing provided, invalid login
        throw new Error();
      }

      const network = findEthereumNetwork(ethereumNetwork);
      dispatch(setEthereumNetwork(network));

      let { user = {} } = await storage.get('user');
      const userState = user.walletId ? REGISTERED : PENDING;
      if (userState === REGISTERED) {
        const fcmToken = await firebase.messaging().getToken().catch(() => null);
        dispatch({ type: UPDATE_SESSION, payload: { fcmToken } });

        await Intercom.sendTokenToIntercom(fcmToken).catch(() => null);
        const signalCredentials = {
          userId: user.id,
          username: user.username,
          walletId: user.walletId,
          ethAddress: wallet.address,
          fcmToken,
        };
        const updateOAuth = updateOAuthTokensCB(dispatch, signalCredentials);
        const onOAuthTokensFailed = onOAuthTokensFailedCB(dispatch);
        api.init(updateOAuth, oAuthTokens, onOAuthTokensFailed, network);

        if (onLoginSuccess && wallet.privateKey) {
          let { privateKey: privateKeyParam } = wallet;
          privateKeyParam = privateKeyParam.indexOf('0x') === 0 ? privateKeyParam.slice(2) : privateKeyParam;
          await onLoginSuccess(privateKeyParam);
        }
github pillarwallet / pillarwallet / src / actions / onboardingActions.js View on Github external
const getTokenWalletAndRegister = async (
  privateKey: string,
  api: Object, // FIXME: this should be api: SDKWrapper
  user: Object,
  dispatch: Dispatch,
) => {
  await firebase.messaging().requestPermission().catch(() => { });
  const fcmToken = await firebase.messaging().getToken().catch(() => { });

  await Intercom.sendTokenToIntercom(fcmToken).catch(() => null);
  const sdkWallet = await api.registerOnAuthServer(privateKey, fcmToken, user.username);
  const registrationSucceed = !sdkWallet.error;
  const userInfo = await api.userInfo(sdkWallet.walletId);
  const userState = Object.keys(userInfo).length ? REGISTERED : PENDING;

  if (Object.keys(userInfo).length) {
    dispatch(saveDbAction('user', { user: userInfo }, true));
  }

  const oAuthTokens = {
    refreshToken: sdkWallet.refreshToken,
    accessToken: sdkWallet.accessToken,
  };

  const updateOAuth = updateOAuthTokensCB(dispatch);
  await updateOAuth(oAuthTokens);
github pillarwallet / pillarwallet / App.js View on Github external
componentWillMount() {
    Intercom.setInAppMessageVisibility('GONE'); // prevent messanger launcher to appear
  }
github pillarwallet / pillarwallet / src / screens / Home / Home.js View on Github external
              onPress: () => Intercom.displayMessenger(),
              withBackground: true,
github rainbow-me / rainbow / src / hoc / withSendFeedback.js View on Github external
  onSendFeedback: () => () => Intercom.displayMessenger(),
})(ComponentToWrap);
github pillarwallet / pillarwallet / src / screens / Exchange / Exchange.js View on Github external
    const rightItems = [{ label: 'Support', onPress: () => Intercom.displayMessenger(), key: 'getHelp' }];
    if ((!isEmpty(exchangeAllowances) || !isEmpty(connectedProviders))
github pillarwallet / pillarwallet / src / screens / Exchange / ExchangeInfo.js View on Github external
          rightItems: [{ link: 'Support', onPress: () => Intercom.displayMessenger() }],
          sideFlex: 2,
github pillarwallet / pillarwallet / src / screens / ManageDetailsSessions / ManageDetailsSessions.js View on Github external
          rightItems: [{ link: 'Support', onPress: () => Intercom.displayMessenger() }],
          sideFlex: 2,