             let json = JSON(parseJSON: (raw["ejson"] as? String) ?? "").dictionary,
             let host = json["host"]?.string,
             let roomId = json["rid"]?.string
-        else {
-            return nil
+            else {
+                return nil
         }
 
         self.host = host
         self.roomId = roomId
+    }
+}
+
+// MARK: Categories
+
+extension UNNotificationAction {
+    static var reply: UNNotificationAction {
+        return UNTextInputNotificationAction(
+            identifier: "REPLY",
+            title: "Repla",
+            options: .authenticationRequired
+        )
+    }
+}
+
+extension UNNotificationCategory {
+    static var message: UNNotificationCategory {
+        return UNNotificationCategory(
+            identifier: "MESSAGE",
+            actions: [.reply],
+            intentIdentifiers: [],
+            options: []
+        )
+    }
+
+    static var messageNoReply: UNNotificationCategory {
+        return UNNotificationCategory(
+            identifier: "REPLY",
+            actions: [.reply],
+            intentIdentifiers: [],
+            options: []
+        )
     }
 }
 

        let notificationCenter = UNUserNotificationCenter.current()
        notificationCenter.delegate = PushManager.delegate
        notificationCenter.requestAuthorization(options: [.alert, .sound, .badge]) { (_, _) in }
    }

    @discardableResult
    static func handleNotification(raw: [AnyHashable: Any]) -> Bool {
        guard let notification = PushNotification(raw: raw) else { return false }
        return handleNotification(notification)
    }

    fileprivate static func hostToServerUrl(_ host: String) -> String? {

            "method": "raix:push-setuser",
            "userId": userIdentifier,
            "params": [getOrCreatePushId()]
            ] as [String: Any]

        SocketManager.send(request)
    }
