ios joplin can't sync to joplin server

I had this problem when I first installed Joplin on my PC and iPad/iPhone. I had installed the apps everywhere first and then set up Joplin cloud sync, but the iOS devices wouldn’t sync. I solved it by deleting and reinstalling the iOS apps and configuring the sync again on those devices.