---
title: "renewCredentials(for:completion:)"
framework: accounts
role: symbol
role_heading: Instance Method
path: "accounts/acaccountstore/renewcredentials(for:completion:)"
---

# renewCredentials(for:completion:)

Renews account credentials when the credentials are no longer valid.

## Declaration

```swift
func renewCredentials(for account: ACAccount!, completion completionHandler: (@Sendable (ACAccountCredentialRenewResult, (any Error)?) -> Void)!)
```

```swift
func renewCredentials(for account: ACAccount!) async throws -> ACAccountCredentialRenewResult
```

## Parameters

- `account`: The account to renew credentials.
- `completionHandler`: The handler to call when the renewal has completed.

## Discussion

Discussion important: You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration: func renewCredentials(for account: ACAccount!) async throws -> ACAccountCredentialRenewResult For information about concurrency and asynchronous code in Swift, see Calling Objective-C APIs Asynchronously. For Twitter and Sina Weibo accounts, this method prompts the user to go to Settings to re-enter their password. For Facebook accounts, if the access token has become invalid due to a regular expiration, this method obtains a new one. If the user has deauthorized your app, this renewal request returns ACAccountCredentialRenewResultRejected.

## See Also

### Renewing Account Credentials

- [ACAccountStoreCredentialRenewalHandler](accounts/acaccountstorecredentialrenewalhandler.md)
- [ACAccountCredentialRenewResult](accounts/acaccountcredentialrenewresult.md)
