This line: https://github.com/ably/tutorials/blob/push-direct-device-registration-ios/testapp/testapp/AppDelegate.swift#L125 deactivates a device's registration after it has established a realtime connection.
A customer copied this pattern, thinking it is necessary.
The tutorial needs to be reviewed and it (and the corresponding website copy) updated.