             status: CDVCommandStatus_ERROR
         )
 
+        NotificationCenter.default.addObserver(self, selector: #selector(CordovaPluginIosAudioPlaylist.audioSessionInterrupted(_:)), name: NSNotification.Name.AVAudioSessionInterruption, object: AVAudioSession.sharedInstance())
+        //NotificationCenter.default.addObserver(self, selector: #selector(CordovaPluginIosAudioPlaylist.audioSessionInterrupted(_:)), name: NSNotification.Name.AVAudioSessionInterruption, object: AVAudioSession.sharedInstance())
         do {
             try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback)
             let _ = try AVAudioSession.sharedInstance().setActive(true)

            callbackId: command.callbackId
        )
    }
}
                messageAs: "success"
            )
        } catch let error as NSError {
            print("an error occurred when setting audio session category.\n \(error)")
            pluginResult.messageAs = "an error occurred when setting audio session category. \(error)";
        }

        self.commandDelegate!.send(
