我提交工单并已经成功开通产品数据统计,但实际调用示例时会报错如下,并无法获得示例中应得的数据
{
"errorCode": -1,
"errorMsg": "IDE 暂时还没实现 API apiRequestByHighway,请使用真机预览,或者真机调试"
}
但在真机调试的时候又会报错“当前app版本无法支持本服务,请升级至最新版本或通过客服联系我们”
Code: Select all
import { resetStatistics,getStatisticsConfig,getAnalyticsLogsPublishLog } from '@ray-js/ray';
export function Home() {
const schema = useDpSchema();//读取dpstate
const items = Object.values(schema);
const {getDeviceInfo} = device;
const {getSubDeviceInfoList} = device;
const [hostname, setHostname] = useState<string>();
const [count, setCount] = useState([]);
const [note, setNote] = useState([]);
const [flag0, setFlag0] = useState(false);
const { setDeviceProperty } = device;
const devInfo = useDevInfo();
function diydevi() {
getStatisticsConfig({
devId: `${devInfo.devId}`,
})
.then((response) => {
console.log('response',response);
})
.catch((error) =>{
console.log(error);
}
)//获取统计配置,获取开通智能计量的 dp 点及配置
}
useEffect(() => {
getAssetHostname().then(setHostname);
}, []);
return (
<>
<button disabled = {flag0} onClick={() => {diydevi();}}>设置设备属性</button>
<ScrollView refresherTriggered={false} className={styles.container}>
<text>
</text>
{count.map(item => (
<DpItem hostname={hostname} item={item} key={item.code} />
))}
{count?.length === 0 && <Text>暂无功能点</Text>}
</ScrollView>
</>
);
}
export default Home;