Sharing a page that's being updated between two devices?

Hello, I’m very new to swift and Xcode, and I have a basic question that I cannot figure out. I’d very much appreciate any sort of hints, comments, or solutions.

The basic framework that my app requires is having two people look at a common apple map(I couldn’t find any built in collaboration api but please correct me if I’m wrong.)

Question: if my code takes device 1’s coordinate input from device1 and takes device2’s coordinate input from device2, how would I apply it to the same map, and return the map with two locations to both devices?

Ultimately, how do apps create a “page” that takes inputs from multiple devices and displays information that is being constantly updated (whether it’s through refreshing the app or through real time updates)?

Here are the steps in my head!

  1. display a map to both users
  2. take coordinate input from device 1
  3. take coordinate input from device 2
  4. add both coordinates to a map view.
  5. somehow(?) display the map with two newly added coordinates to both users!

Thank you so much for your time if you do consider my question! I definitely appreciate it!

I haven’t specifically worked with maps, but you’ll need some back end to store these locations and then download them to each device