<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "watchOS: 7.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NearbyInteraction",
  "identifier" : "/documentation/NearbyInteraction/NISessionDelegate/sessionWasSuspended(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Nearby Interaction"
    ],
    "preciseIdentifier" : "c:objc(pl)NISessionDelegate(im)sessionWasSuspended:"
  },
  "title" : "sessionWasSuspended(_:)"
}
-->

# sessionWasSuspended(_:)

Notifies you of a suspended session.

```
optional func sessionWasSuspended(_ session: NISession)
```

## Parameters

`session`

The session that NI suspended.

## Discussion

When NI invokes this callback, the session suspends and doesn’t receive [`session(_:didUpdate:)`](/documentation/NearbyInteraction/NISessionDelegate/session(_:didUpdate:)) callbacks. NI suspends a session when the user backgrounds the app. If the user reactivates the app before NI times out the session, NI calls [`sessionSuspensionEnded(_:)`](/documentation/NearbyInteraction/NISessionDelegate/sessionSuspensionEnded(_:)). A suspended session won’t resume on its own. To resume the session, call [`run(_:)`](/documentation/NearbyInteraction/NISession/run(_:)) again, passing in your session’s configuration.

If the app stays backgrounded for too long during a suspension, NI invalidates the session (see [`session(_:didInvalidateWith:)`](/documentation/NearbyInteraction/NISessionDelegate/session(_:didInvalidateWith:))) and the peer user’s session invokes [`session(_:didRemove:reason:)`](/documentation/NearbyInteraction/NISessionDelegate/session(_:didRemove:reason:)) with `reason` [`NINearbyObject.RemovalReason.timeout`](/documentation/NearbyInteraction/NINearbyObject/RemovalReason/timeout).

Additionally, the system may suspend a session for internal reasons.

---

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)