mattermost-mobile-upstream/libraries/@mattermost/hardware-keyboard/ios/MattermostHardwareKeyboardWrapper.swift
Carlos Garcia f2857a97d1
Mm 67525 bump min version (#9640)
* bumps minSdkVersion to 30

Older versions are past end-of-life for security patches. voximplant service patch is also updated with minSdkVersion set to 30.

* removes manifest attributes no longer needed when minSdk is 30

* removes guard to for version lower than O

* removes permission check for versions lower than 28

* remove tests related to unsupported android sdk versions

* bumps iOS minSdkVersion to 18

* removes iOS 13/15 guards in hardware-keyboard

* removes iOS 15 guards in NotificationService

* removes iOS 15 guard in Gekidou network delegate

since gekidou is iOS only other platform guards are not needed

* removes version guard no longer needed in voximplant patch

* removes hasWriteStoragePermission dead stub and its call site

* removes unused setSoftKeyboardToAdjustResize from rnutils

The function had no call sites in JS/TS code and the iOS implementation
was a no-op.

* removes version guards and updates config after min version bump

* updates stale iOS 17 simulator references in CI to iOS 18.1

Co-Authored-By: Carlos Garcia <carlos.garcia@mattermost.com>

* fixes malformed patch file headers

- voximplant patch: restore missing diff --git header and index line
  for VIForegroundServiceModule.java, fix stale hunk counter (+11 -> +7)
- notifications patch: fix stale hunk line count (+91 -> +89) after
  KITKAT branch removal

Co-Authored-By: Carlos Garcia <carlos.garcia@mattermost.com>

* remove code below the supported OS versions

* Bump IntuneMAM SDK to 21.8.0 and MSAL to 2.15.0

---------

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2026-09-16 10:53:06 +00:00

49 lines
1.8 KiB
Swift

import Foundation
@objc public class MattermostHardwareKeyboardWrapper: NSObject {
@objc public static weak var delegate: MattermostHardwareKeyboardDelegate? = nil
private override init() {}
@objc public static func enterKeyPressed() {
delegate?.sendEvent(name: Event.mmHardwareKeyboardEvent.rawValue, result: [
"action": "enter"
])
}
@objc public static func shiftEnterKeyPressed() {
delegate?.sendEvent(name: Event.mmHardwareKeyboardEvent.rawValue, result: [
"action": "shift-enter"
])
}
@objc public static func findChannels() {
delegate?.sendEvent(name: Event.mmHardwareKeyboardEvent.rawValue, result: [
"action": "find-channels"
])
}
@objc public static func registerKeyCommands(enterPressed: Selector, shiftEnterPressed: Selector, findChannels: Selector) -> NSMutableArray {
let commands = NSMutableArray()
let enter = UIKeyCommand(input: "\r", modifierFlags: [], action: enterPressed)
let shiftEnter = UIKeyCommand(input: "\r", modifierFlags: .shift, action: shiftEnterPressed)
let findChannels = UIKeyCommand(input: "k", modifierFlags: .command, action: findChannels)
enter.title = "Send message"
enter.discoverabilityTitle = "Send message"
shiftEnter.title = "Add new line"
shiftEnter.discoverabilityTitle = "Add new line"
findChannels.title = "Find channels"
findChannels.discoverabilityTitle = "Find channels"
enter.wantsPriorityOverSystemBehavior = true
shiftEnter.wantsPriorityOverSystemBehavior = true
findChannels.wantsPriorityOverSystemBehavior = true
commands.add(enter)
commands.add(shiftEnter)
commands.add(findChannels)
return commands
}
}