<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WatchConnectivity",
  "identifier" : "/documentation/WatchConnectivity/WCSessionDelegate/session(_:didReceive:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Watch Connectivity"
    ],
    "preciseIdentifier" : "c:objc(pl)WCSessionDelegate(im)session:didReceiveFile:"
  },
  "title" : "session(_:didReceive:)"
}
-->

# session(_:didReceive:)

Tells the delegate that the session successfully received a file from its counterpart.

```
optional func session(_ session: WCSession, didReceive file: WCSessionFile)
```

## Parameters

`session`

The session object of the current process.

`file`

The object containing the URL of the file and any additional information. If you want to keep the file referenced by this parameter, you must move it synchronously to a new location during your implementation of this method. If you don’t move the file, the system deletes it after this method returns.

## Discussion

The session object calls this method when it successfully receives a file from its counterpart. Implement this method to incorporate the file information into the current app. The system calls this method on a background thread.

Remember to move the file referenced by the `file` parameter if you intend to keep it. If you don’t move the file synchronously during your implementation of this method, the system deletes the file when the method returns.

> Warning:
> Always test Watch Connectivity file transfers on paired devices. The system doesn’t call the ``doc://com.apple.watchconnectivity/documentation/WatchConnectivity/WCSessionDelegate/session(_:didReceive:)`` method in Simulator.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)