The rule that actually predicts the answer
If a platform re-compresses your image to save bandwidth, metadata is usually lost as a side effect. If it treats your upload as a file to be delivered intact, everything survives. This is why the same app can behave in two different ways depending on which button you press.
Sending as a photo versus sending as a document
In most messengers, attaching an image through the gallery picker compresses it and strips most metadata. Attaching the same image through the document or file option delivers the original bytes, GPS and all. People reach for the document option precisely when quality matters, which is exactly when the original metadata is intact.
Email and cloud links do nothing at all
An email attachment is delivered byte for byte. A link to a file in cloud storage serves the original file. Neither strips anything, and neither warns you. These are the routes most often used for a CV, a contract or a scan of a document, which are also the files most likely to carry a name.
Do not rely on the platform
Behaviour changes between app versions without announcement, and differs by platform and region. If it matters, strip it yourself before you send it, and then it does not matter what the platform does.