Skip to content

httpRequest error on AppService #10

@miguelavh

Description

@miguelavh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions