<!--
{
  "availability" : [
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSBackgroundActivityScheduler/init(identifier:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSBackgroundActivityScheduler(im)initWithIdentifier:"
  },
  "title" : "init(identifier:)"
}
-->

# init(identifier:)

Initializes a background activity scheduler object with a specified unique identifier.

```
init(identifier: String)
```

## Parameters

`identifier`

A unique string, in reverse DNS notation, that identifies the activity. For example, `com.example.MyApp.updatecheck`. `nil` and zero-length strings are not allowed.

## Return Value

A new background activity scheduler object of type [`NSBackgroundActivityScheduler`](/documentation/Foundation/NSBackgroundActivityScheduler).

## Discussion

The string passed to the `identifier` parameter should remain constant for an activity across launches of your app because the system uses this unique identifier to track the number of times the activity has run and to improve the heuristics for deciding when to run it again in the future. See [`Create a Scheduler`](/documentation/Foundation/NSBackgroundActivityScheduler#Create-a-Scheduler).

## See Also

[`identifier`](/documentation/Foundation/NSBackgroundActivityScheduler/identifier)

A unique reverse DNS notation string, such as `com.example.MyApp.updatecheck`, that identifies the activity.



---

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)