 			)
 		}
 
-		callback(result: .Success(message))
+		if let presenceEvent = Event.PhoenixEvent.PresenceEvent(rawValue: event.rawValue) where shouldTrackPresence {
+			print(presenceEvent)
+			print(ref)
+			print(payload)
+		}
 	}
 
 	/// <#Description#>

	}

	internal func triggerEvent(event: Event, ref: String? = nil, payload: [String: AnyObject] = [:]) {
		guard let callback = eventBindings[event] else {
			return
		}

		let message = Message(
			topic: topic,
			event: event,
			payload: payload,
			ref: ref
		)

		if let defaultEvent = Event.PhoenixEvent(rawValue: event.rawValue) {
			triggerInternalEvent(


	public typealias Callback = (result: Result<Message>) -> Void
	public private(set) var state: ChannelState = .Closed

	public var shouldTrackPresence = false

	private var eventBindings = [Event: ResultCallback]()
	private var callbackBindings = [String: ResultCallback?]()
