【发布时间】:2022-01-15 13:37:13
【问题描述】:
我需要在我的 react 本机应用程序中通过电子邮件发送来自 SQLite 的数据。我希望 SQLite 中的数据位于电子邮件正文中
这是我目前得到的:
const getSqliteData = () => {
db.transaction(
(tx) => {
tx.executeSql("select * from cart", [], (_, { rows }) =>
JSON.stringify(rows)
);
}
);
};
return (
<SafeAreaView style={{ flex: 1 }}>
<View style={{ flex: 1, backgroundColor: "white" }}>
// some other stuff
<TouchableOpacity style={styles.buttonsend} onPress={ () => {
sendEmail(
'',
'',
'This was sent from my-app -- ' + getSqliteData,
{ cc: '' }
).then(() => {
console.log('Your message was successfully sent!');
})
}}>
<Text style={styles.buttontext}>Email</Text>
</TouchableOpacity>
它不会抛出任何错误,只是不返回任何数据。
谢谢
【问题讨论】:
标签: android ios react-native expo