I can't imagine how it would be possible to detect a phone in close proximity without allowing this though
That's what Bump did, like 13 years ago, by sending accelerometer and GPS data up to the cloud and correlating it there.
It works in isolation and fails miserably when trying to do a big demo of it in a conference talk when attempted by dozens of people in the same room.
NFC?
Accelerometer, by putting the two phones together and shaking (some app used to do this, but I can't find it with a quick search). Edit: I might have been thinking of Bump, mentioned downthread, though it's a different physical mechanism: https://en.wikipedia.org/wiki/Bump_(application)
Camera, and point it at their changing screen (or both at the same scene at the same moment). Not too intrusive.
GPS, but that would require location permission. Intrusive.
Audio, but that would require allowing microphone. Intrusive.