NativeCap.swift 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. // MyPlugin.swift
  3. // App
  4. //
  5. // Created by Akhmad Al Qindi Irsyam on 27/06/23.
  6. //
  7. import Foundation
  8. import Capacitor
  9. import NexilisLite
  10. @objc(NativeCap)
  11. public class NativeCap: CAPPlugin {
  12. @objc func openContactCenter(_ call: CAPPluginCall) {
  13. DispatchQueue.main.async {
  14. APIS.openContactCenter()
  15. }
  16. }
  17. @objc func openChat(_ call: CAPPluginCall) {
  18. DispatchQueue.main.async {
  19. APIS.openChat()
  20. }
  21. }
  22. @objc func openCall(_ call: CAPPluginCall) {
  23. DispatchQueue.main.async {
  24. APIS.openCall()
  25. }
  26. }
  27. @objc func openStreaming(_ call: CAPPluginCall) {
  28. DispatchQueue.main.async {
  29. APIS.openStreaming()
  30. }
  31. }
  32. @objc func openSetOfficer(_ call: CAPPluginCall) {
  33. DispatchQueue.main.async {
  34. APIS.openSetAsOfficerForm()
  35. }
  36. }
  37. @objc func openSettings(_ call: CAPPluginCall) {
  38. DispatchQueue.main.async {
  39. APIS.openSetting()
  40. }
  41. }
  42. @objc func openProfile(_ call: CAPPluginCall) {
  43. DispatchQueue.main.async {
  44. APIS.openProfile()
  45. }
  46. }
  47. @objc func openContactCenterChat(_ call: CAPPluginCall) {
  48. let media = 0
  49. let category = call.options["category"]
  50. print("HEHE \(category)")
  51. DispatchQueue.main.async {
  52. APIS.openContactCenter(media: media, category: category as? Int)
  53. }
  54. }
  55. @objc func openContactCenterAudioCall(_ call: CAPPluginCall) {
  56. let media = 1
  57. let category = call.options["category"]
  58. DispatchQueue.main.async {
  59. APIS.openContactCenter(media: media, category: category as? Int)
  60. }
  61. }
  62. @objc func openContactCenterVideoCall(_ call: CAPPluginCall) {
  63. let media = 2
  64. let category = call.options["category"]
  65. DispatchQueue.main.async {
  66. APIS.openContactCenter(media: media, category: category as? Int)
  67. }
  68. }
  69. @objc func adminSignIn(_ call: CAPPluginCall) {
  70. let password = call.options["pwd"] ?? ""
  71. DispatchQueue.main.async {
  72. APIS.signInAdmin(password: password as! String)
  73. }
  74. }
  75. @objc func openScreenSharing(_ call: CAPPluginCall) {
  76. DispatchQueue.main.async {
  77. APIS.openScreenSharing()
  78. }
  79. }
  80. @objc func openWhiteboard(_ call: CAPPluginCall) {
  81. DispatchQueue.main.async {
  82. APIS.openWhiteboard()
  83. }
  84. }
  85. }