If a sender chooses the wrong device from the list of nearby devices and sends the file, you will receive a Receive notification. It is safe not to accept files if you receive a notification from an unknown device.
You can set whether your device is visible to nearby devices in Settings.
1. Tap ☰ Menu icon in the top left corner.
2. Tap ⚙ Settings in the top right corner.
3. Under Manage Devices, tap Find Nearby Devices option to deactivate it.