Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// @flow
import builder from 'react-native-version-check/builder';
import VersionInfo from './src/ExpoVersionInfo';
export default builder(VersionInfo);
componentDidMount() {
VersionCheck.needUpdate({
latestVersion: '1.0.0',
}).then(res => this.setState(res));
VersionCheck.getStoreUrl({ appID: '364709193' }).then(res => {
//App Store ID for iBooks.
this.setState({ storeUrl: res });
});
}
render() {
handleAppStoreLink = async () => {
try {
Linking.openURL(
await VersionCheck.getStoreUrl({ appName: appNameIos, appID: appIdIos })
);
} catch (e) {
this.props.onError(e);
}
};
async componentDidMount() {
const versionInfo: VersionInfo = await VersionCheck.needUpdate();
const askLaterTime = await getAppUpdateAskLaterTime();
const updateMessageSuppressed =
!!askLaterTime && isBefore(now(), askLaterTime);
const showAppStoreAlert = versionInfo.isNeeded && !updateMessageSuppressed;
if (showAppStoreAlert) {
this.handleAppStoreAlert();
}
}
componentDidMount() {
VersionCheck.needUpdate({
latestVersion: '1.0.0',
}).then(res => this.setState(res));
VersionCheck.getStoreUrl({ appID: '364709193' }).then(res => {
//App Store ID for iBooks.
this.setState({ storeUrl: res });
});
}
render() {
export async function generateLink(inviteCode: string, recipientName: string) {
const packageName = VersionCheck.getPackageName().replace(/\.debug$/g, '.integration')
const playStoreLink = await VersionCheck.getPlayStoreUrl({ packageName })
const referrerData = encodeURIComponent(`invite-code=${inviteCode}`)
const referrerLink = `${playStoreLink}&referrer=${referrerData}`
const shortUrl = await dynamicLink(referrerLink)
const msg = i18n.t('sendFlow7:inviteSMS', {
name: recipientName,
code: inviteCode,
link: shortUrl,
})
return msg
}
export async function generateLink(inviteCode: string, recipientName: string) {
const packageName = VersionCheck.getPackageName().replace(/\.debug$/g, '.integration')
const playStoreLink = await VersionCheck.getPlayStoreUrl({ packageName })
const referrerData = encodeURIComponent(`invite-code=${inviteCode}`)
const referrerLink = `${playStoreLink}&referrer=${referrerData}`
const shortUrl = await dynamicLink(referrerLink)
const msg = i18n.t('sendFlow7:inviteSMS', {
name: recipientName,
code: inviteCode,
link: shortUrl,
})
return msg
}