You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

30 rivejä
748 B

  1. //
  2. // StreamHandler.swift
  3. // pusher_client
  4. //
  5. // Created by Romario Chinloy on 10/29/20.
  6. //
  7. class StreamHandler: NSObject, FlutterStreamHandler {
  8. static let `default`: StreamHandler = StreamHandler()
  9. private override init(){}
  10. struct Utils {
  11. static var eventSink: FlutterEventSink?
  12. }
  13. func onListen(withArguments arguments: Any?, eventSink events: @escaping FlutterEventSink) -> FlutterError? {
  14. Utils.eventSink = events
  15. PusherService.Utils.debugLog(msg: "Event stream listening...")
  16. return nil
  17. }
  18. func onCancel(withArguments arguments: Any?) -> FlutterError? {
  19. PusherService.Utils.debugLog(msg: "Event stream cancelled.")
  20. return nil
  21. }
  22. }