apple: refactor
write positions to db

[Deliver #59942720]