<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.14.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSString/localizedUserNotificationString(forKey:arguments:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSString(cm)localizedUserNotificationStringForKey:arguments:"
  },
  "title" : "localizedUserNotificationString(forKey:arguments:)"
}
-->

# localizedUserNotificationString(forKey:arguments:)

Returns a localized string intended for display in a notification alert.

```
class func localizedUserNotificationString(forKey key: String, arguments: [Any]?) -> String
```

## Parameters

`key`

The key to use when looking up the string in the app’s `Localizable.strings` file.

`arguments`

An array of values to substitute for escaped characters in the string.

## Return Value

A string whose value is created dynamically from a localized string resource. If a string resource corresponding to the specified `key` cannot be found, this method returns `key`.

## Discussion

When configuring the content of a local notification using the User Notifications framework, use this method to create strings whose contents are stored in your app’s `Localizable.strings` file. When the notification is about to be displayed, the string object uses the key and arguments you specify to load the appropriate localized version of the string. If the localized string has any escaped character sequences—that is, special characters proceeded by a percent (%) sign—those character sequences are replaced by the values in the `arguments` parameter.

For information about how strings are formatted, see [String Resources](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html#//apple_ref/doc/uid/10000051i-CH6) in [Resource Programming Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/LoadingResources/Introduction/Introduction.html#//apple_ref/doc/uid/10000051i).

---

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)