问题描述
如何在common.tfvars文件中注入环境变量
ex
function Phone() {
// If null,no SMS has been sent
const [confirm,setConfirm] = useState(null);
const [code,setCode] = useState('');
// Handle the button press
async function signInWithPhoneNumber(phoneNumber) {
const confirmation = await auth().signInWithPhoneNumber(phoneNumber);
setConfirm(confirmation);
}
async function confirmCode() {
try {
await confirm.confirm(code);
} catch (error) {
console.log('Invalid code.');
}
}
//+20 123 456 9879
if (!confirm) {
return (
<View style={{flex: 1,justifyContent: 'center',alignItems: 'center'}}>
<Button
title="Phone Number Sign In"
onPress={() => signInWithPhoneNumber('//My real number')}
/>
</View>
);
}
return (
<>
<TextInput value={code} onChangeText={text => setCode(text)} />
<Button title="Confirm Code" onPress={() => confirmCode()} />
</>
);
}
export default Phone;
并在common.tfvars中使用它
export TF_VAR_ENV="test"
提前感谢您的帮助
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)