我在做一个定时器,到了设定的时间,怎样执行设定的时间任务? 如果登陆小程序,也可以自动执行,求代码
怎样定时执行设定的时间任务?How to execute the set time task regularly?
怎样定时执行设定的时间任务?我在做一个定时器,到了设定的时间,怎样执行设定的时间任务? 如果登陆小程序,也可以自动执行,求代码
I'm making a timer. When the set time comes, how to execute the set time task? If you log in to the applet, it can also be executed automatically to find the code
回答:
云开发支持的,小程序端 只能接口判断。
https://developers.weixin.qq.com/miniprogram/dev/wxcloud/guide/functions/triggers.html
这是云开发的文档
云开发可以,小程序不在前台没办法一直保持活跃。
原文出处:怎样定时执行设定的时间任务?
云开发可以设定定时执行某个云函数。https://developers.weixin.qq.com/miniprogram/dev/wxcloud/guide/functions/triggers.html
登录小程序自动执行,可以在onload中去执行