Learn how to deauthorize the current Square account location in a Reader SDK application.
Deauthorize the Reader SDK
You need to install and configure the Reader SDK.
To switch Square locations or deauthorize the current location, you need to add code that deauthorizes the Reader SDK.
import SquareReaderSDK
func deauthorizeReaderSDKIfPossible() {
if SQRDReaderSDK.shared.canDeauthorize {
SQRDReaderSDK.shared.deauthorize { error in
if let deauthError = error {
// Handle error
print(deauthError)
} else {
// Deauthorization succeeded
}
}
} else {
print("Cannot deauthorize.")
}
}