I have some pyscript code that works just fine on all desktop browsers, it does as the last line of the myapp.py:
my_loop = PyScript.loop.create_task(app.my_recurring_action())
with my_recurring_action being:
async def my_recurring_action(self):
while (True):
response = await pyfetch(url=f"https://my_app_changes/{time.time()}/", method="GET")
response_list = await response.json()
for changed in response_list:
self.change_it(changed['id'], changed['attrib1'], changed['attrib2'])
await asyncio.sleep(1)
def change_it(self, id, i, j):
move_me = self.scene.getObjectById(unit_to_mesh_id[id], True)
move_me.position.x = i
move_me.position.z = j
On desktop the threejs object changes its position just fine each second, it refreshes.
On Android (Chrome, Opera, Hermit) nothing happens: triggering the position change from Android works, but the object stays in place on the canvas.