How to use the react-native-config.RN_TEMPORARY_REFERRAL function in react-native-config

To help you get started, we’ve selected a few react-native-config 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 textileio / photos / App / Sagas / DeepLinkSagas.ts View on Github external
export function* routeThreadInvite(url: string, hash: string) {
  const reduxStarted: boolean = yield select(startupSelectors.started)
  if (!reduxStarted) {
    yield take(getType(StartupActions.startup))
  }
  if (yield select(PreferencesSelectors.onboarded)) {
    NavigationService.navigate('ThreadInvite', { ...DeepLink.getParams(hash) })
  } else {
    // simply store the pending invite information to act on after onboarding success
    const data = DeepLink.getParams(hash)
    const code: string = data.referral as string
    const referral =
      code.toLowerCase() === Config.RN_TEMPORARY_REFERRAL.toLowerCase()
        ? code
        : undefined
    yield put(AuthActions.onboardWithInviteRequest(url, hash, referral))
  }
}
github textileio / photos / App / features / contacts / sagas.ts View on Github external
const home = phoneNumbers.find(
      number => number.label.toLowerCase() === 'home'
    )
    const work = phoneNumbers.find(
      number => number.label.toLowerCase() === 'work'
    )
    const sendTo = iphone || mobile || home || work
    if (sendTo) {
      const username: string | undefined = yield select((state: RootState) =>
        accountSelectors.getUsername(state.account)
      )
      const address: string | undefined = yield select((state: RootState) =>
        accountSelectors.getAddress(state.account)
      )
      const url = `https://www.textile.photos/invites/new#name=new&inviter=${username}&referral=${
        Config.RN_TEMPORARY_REFERRAL
      }`
      let message = `Join me on Textile Photos: ${url}`
      if (username) {
        message = `${message}\nMy username: ${username}`
      }
      if (address) {
        message = `${message}\nMy address snippet: ${address.substr(
          address.length - 8,
          8
        )}`
      }
      yield call(composeMessage, sendTo.number, message)
    }
  }
}
github textileio / photos / App / Containers / OnboardingScreen / index.tsx View on Github external
(
        
      )
    ]
    if (!this.props.skipReferralCode) {
      pages.splice(3, 0, (
        
      ))
    }
    if (this.props.pendingMigration) {
      pages.unshift((
        
          We're working fast to make Textile Photos even better.
          Your old data isn't compatible with this new version of the app,
          so you'll be starting fresh now. Check out your Notifications
          screen to get started migrating your old data if you'd like.
github textileio / photos / App / Services / DeepLink.ts View on Github external
function createInviteLink(invite: IExternalInvite, threadName: string): string {
  const hash: string[] = []
  hash.push(`id=${encodeURIComponent(invite.id)}`)
  hash.push(`key=${encodeURIComponent(invite.key)}`)
  hash.push(`inviter=${encodeURIComponent(invite.inviter)}`)
  hash.push(`name=${encodeURIComponent(threadName)}`)
  if (Config.RN_TEMPORARY_REFERRAL) {
    hash.push(`referral=${encodeURIComponent(Config.RN_TEMPORARY_REFERRAL)}`)
  }
  return `https://www.textile.photos/invites/new#${hash.join('&')}`
}
github textileio / photos / App / Services / DeepLink.ts View on Github external
function createInviteLink(invite: IExternalInvite, threadName: string): string {
  const hash: string[] = []
  hash.push(`id=${encodeURIComponent(invite.id)}`)
  hash.push(`key=${encodeURIComponent(invite.key)}`)
  hash.push(`inviter=${encodeURIComponent(invite.inviter)}`)
  hash.push(`name=${encodeURIComponent(threadName)}`)
  if (Config.RN_TEMPORARY_REFERRAL) {
    hash.push(`referral=${encodeURIComponent(Config.RN_TEMPORARY_REFERRAL)}`)
  }
  return `https://www.textile.photos/invites/new#${hash.join('&')}`
}