<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SiriKit",
  "identifier" : "/documentation/Intents/INMediaUserContext",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Intents"
    ],
    "preciseIdentifier" : "c:objc(cs)INMediaUserContext"
  },
  "title" : "INMediaUserContext"
}
-->

# INMediaUserContext

An object that provides user information to Siri.

```
class INMediaUserContext
```

## Overview

When your media app launches, create an [`INMediaUserContext`](/documentation/Intents/INMediaUserContext). Provide the number of items the user has in their library and indicate whether the user has a current paid subscription. Then call [`becomeCurrent()`](/documentation/Intents/INUserContext/becomeCurrent()) to share this user context with the system. The following code listing shows how to set the current context for a user with a paid subscription and a few hundred items in their library:

```swift
let context = INMediaUserContext()
context.numberOfLibraryItems = 345
context.subscriptionStatus = .subscribed
context.becomeCurrent()
```

## Topics

### Creating a new Media User Context

[`init()`](/documentation/Intents/INMediaUserContext/init())

Creates a new media user context object.

### Accessing the Media Context Information

[`numberOfLibraryItems`](/documentation/Intents/INMediaUserContext/numberOfLibraryItems-8rnf0)

An approximate number of relevant items available in the users library.

[`numberOfLibraryItems`](/documentation/Intents/INMediaUserContext/numberOfLibraryItems-881cf)

An approximate number of relevant items available in the users library.

[`subscriptionStatus`](/documentation/Intents/INMediaUserContext/subscriptionStatus-swift.property)

The user’s current subscription status.

[`INMediaUserContext.SubscriptionStatus`](/documentation/Intents/INMediaUserContext/SubscriptionStatus-swift.enum)

Constants that describe the current description status.



---

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)