Fault 5000

Hi,
I recently started getting this error on devices that had just worked 1 hour ago. Did something happen to the server?
Optional(FAULT = ‘5000’ [Unable to retrieve device. Invalid device ID.] <Unable to retrieve device. Invalid device ID.> )

Here’s the code that I’m running.

func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {

// Get previous channel registrations
var error: Fault?

let registrations = backendless.messaging.getRegistrationError(&error)

if error == nil {
backendless.messaging.registerDevice(registrations.channels as! [String], expiration: nil, token: deviceToken, error: &error)

print("\nRegistering device token")
print(registrations.channels)
print(" ")
} else {
print(error)
}

}

Ok, my bad. I accidentally commented out the very important line below.
If you ever get a 5000 fault code, first check that you have registerDeviceToken uncommented.

func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {

    

    backendless.messaging.registerDeviceToken(deviceToken)

backendless?.messaging.registerDeviceToken(deviceToken) is in uncommented only.
still getting: Server reported an error: Optional(FAULT = ‘5000’ [Unable to retrieve device. Invalid device ID.] <Unable to retrieve device. Invalid device ID.> )

How do you obtain the device token?