目前这个api只能导出到邮箱里,但是我发现有款小程序,可以将数据分享到其他app中,我想知道是怎么实现的
exportStatisticsHour导出的数据如何发送到其他app
-
- Posts: 150
Re: exportStatisticsHour导出的数据如何发送到其他app
调用 share, 可调起 app的分享方法, https://developer.tuya.com/cn/miniapp/d ... iner/share
-
- Posts: 150
Re: exportStatisticsHour导出的数据如何发送到其他app
crisiron 2025年 Apr 1日 15:29调用 share, 可调起 app的分享方法, https://developer.tuya.com/cn/miniapp/d ... iner/share
你好,share可以分享文件这些,但是数据统计exportStatisticsDay导出的文件好像只能发往邮箱。share分享文件需要文件地址,我想知道exportStatisticsDay导出的文件存放在哪里
Re: exportStatisticsHour导出的数据如何发送到其他app
使用https://developer.tuya.com/cn/miniapp/develop/ray/api/meature/getStatisticsRangDay 获取到数据后,传入 share
-
- Posts: 150
Re: exportStatisticsHour导出的数据如何发送到其他app
crisiron 2025年 Apr 2日 09:27使用https://developer.tuya.com/cn/miniapp/develop/ray/api/meature/getStatisticsRangDay 获取到数据后,传入 share
你好,我代码如下,在数据成功获取的情况下,并没能打开分享界面。我看了share的示例,还是原生小程序写法,是还没有封装进ray嘛?
Code: Select all
const handleGetAndShare = () => {
getStatisticsRangDay({
devId: devInfo.devId,
dpId: 106,
startDay: '20250401',
endDay: '20250401',
type: 'avg',
})
.then((response) => {
console.log('导出的数据', response);
share({
type: 'WeChat',
title: '分享统计数据',
message: `统计数据: ${JSON.stringify(response)}`,
contentType: 'text',
success(info) {
console.log('微信分享成功', info);
},
fail(error) {
console.error('微信分享失败', error);
},
complete(info){
console.log('微信分享完成', info);
}
});
})
.catch((error) => {
console.error('获取统计数据失败', error);
});
};
Re: exportStatisticsHour导出的数据如何发送到其他app
提供下机型与系统版本以及 APP 版本, 可先看看 文档中提供的示例 https://developer.tuya.com/cn/miniapp/d ... hare#share
-
- Posts: 150
Re: exportStatisticsHour导出的数据如何发送到其他app
crisiron 2025年 Apr 2日 11:51提供下机型与系统版本以及 APP 版本, 可先看看 文档中提供的示例 https://developer.tuya.com/cn/miniapp/d ... hare#share
机型为iphone13 ,系统为18.3.2,智能生活版本为6.4.0。
目前能正确触发打开分享界面,但是存在以下两个个问题。
1:contentType为text的时候,获取到的数据在我iPhone13无法转发到微信里,安卓端则是以文本形式转发出去了
2:getStatisticsRangDay无法将数据以excel文件形式传出,并让我share进行转发
ios分享到微信的界面
安卓成功分享出去