Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

httpRequest error on AppService #10

Open
miguelavh opened this issue Sep 3, 2024 · 0 comments
Open

httpRequest error on AppService #10

miguelavh opened this issue Sep 3, 2024 · 0 comments

Comments

@miguelavh
Copy link

miguelavh commented Sep 3, 2024

Hi, I'm making an appservice and I want to make one httpRequest, When I start the time service (every minute make an httrequest) it fails, but I have added a notify and works so timeservice is working properly, but httpRequest doesn't work... But If I start the service and reboot watch, whe It start the time service comes to life, all works perfect, notify and httpRequest... It's like something has not been initialize properly... My watch is Amazfit Active with Zeppos4, and zml is 0.0.23... So a piece of my code is:

AppService(
BasePage({
onInit(_) {
timeSensor.onPerMinute(() => {
this.getMetrics();
});
},
getMetrics() {
this.httpRequest({
method: 'GET',
url: endPoint,
headers: {
'Content-Type': 'application/json'
}
})
.then((result) => {
try
{
const status = JSON.stringify(result);
}).catch((error) => {
});
},
onDestroy() {
//logger.log("service on destroy invoke");
},
}));

Please can you see what would be the problem?

Thank you very much.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant