                     self.failedRequestAttempts += 1
 
                     if error != nil {
-                        self.socketConnection?.delegate?.debugLog?(message: "Error when trying to modify subscription to interest: \(error?.localizedDescription)")
+                        self.delegate?.debugLog?(message: "Error when trying to modify subscription to interest: \(error?.localizedDescription)")
                     } else if data != nil && response != nil {
                         let responseBody = String(data: data!, encoding: .utf8)
-                        self.socketConnection?.delegate?.debugLog?(message: "Bad response from server: \(response!) with body: \(responseBody)")
+                        self.delegate?.debugLog?(message: "Bad response from server: \(response!) with body: \(responseBody)")
                     } else {
-                        self.socketConnection?.delegate?.debugLog?(message: "Bad response from server when trying to modify subscription to interest: \(interest)")
+                        self.delegate?.debugLog?(message: "Bad response from server when trying to modify subscription to interest: \(interest)")
                     }
 
                     if self.failedRequestAttempts >= self.maxFailedRequestAttempts {
-                        self.socketConnection?.delegate?.debugLog?(message: "Max number of failed native service requests reached")
+                        self.delegate?.debugLog?(message: "Max number of failed native service requests reached")
 
                         self.requestQueue.paused = true
                     } else {
-                        self.socketConnection?.delegate?.debugLog?(message: "Retrying subscription modification request for interest: \(interest)")
+                        self.delegate?.debugLog?(message: "Retrying subscription modification request for interest: \(interest)")
                         self.requestQueue.retry(Double(self.failedRequestAttempts * self.failedRequestAttempts))
                     }
 

        - parameter callback:     Callback to be called upon success
    */
    private func modifySubscription(interest: String, change: SubscriptionChange, successCallback: @escaping (Any?) -> Void) {
        guard pusherAppKey != nil, clientId != nil else {
            self.socketConnection?.delegate?.debugLog?(message: "pusherAppKey \(pusherAppKey) or clientId \(clientId) not set - waiting for both to be set")
            self.requestQueue.pauseAndResetCurrentTask()
            return
        }

        self.socketConnection?.delegate?.debugLog?(message: "Attempt number: \(self.failedRequestAttempts + 1) of \(maxFailedRequestAttempts)")

        let url = "\(CLIENT_API_V1_ENDPOINT)/clients/\(clientId!)/interests/\(interest)"
        var request = URLRequest(url: URL(string: url)!)

    Notifications are published to "interests".
    Clients (such as this app instance) subscribe to those interests.

    A per-app instance NativePusher is available via an instance of Pusher.
*/
@objc open class NativePusher: NSObject {
    private static let PLATFORM_TYPE = "apns"
    private let CLIENT_API_V1_ENDPOINT = "https://nativepushclient-cluster1.pusher.com/client_api/v1"
    private let LIBRARY_NAME_AND_VERSION = "pusher-websocket-swift " + VERSION
