CallNative.swift 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. //
  2. // APIS.swift
  3. // example_code_react_native
  4. //
  5. // Created by Akhmad Al Qindi Irsyam on 27/06/23.
  6. //
  7. import Foundation
  8. import NexilisLite
  9. @objc(CallNative)
  10. class CallNative: NSObject, ConnectDelegate {
  11. func onSuccess(userId: String) {
  12. print("SUCCESS HMM \(userId)")
  13. }
  14. func onFailed(error: String) {
  15. print("FAILED HMM")
  16. }
  17. @objc func connect() {
  18. print("CONNECTSKUTT")
  19. APIS.connect(apiKey: "***REPLACE***WITH***YOUR***ACCOUNT***", delegate: self, showButton: false)
  20. }
  21. @objc func openContactCenter() {
  22. print("openContactCenter")
  23. DispatchQueue.main.async {
  24. APIS.openContactCenter()
  25. }
  26. }
  27. @objc func openChat() {
  28. print("openChat")
  29. DispatchQueue.main.async {
  30. APIS.openChat()
  31. }
  32. }
  33. @objc func openCall() {
  34. print("openCall")
  35. DispatchQueue.main.async {
  36. APIS.openCall()
  37. }
  38. }
  39. @objc func openStreaming() {
  40. print("openStreaming")
  41. DispatchQueue.main.async {
  42. APIS.openStreaming()
  43. }
  44. }
  45. @objc func openSetting() {
  46. print("openSetting")
  47. DispatchQueue.main.async {
  48. APIS.openSetting()
  49. }
  50. }
  51. @objc func openWhiteboard() {
  52. print("openWhiteboard")
  53. DispatchQueue.main.async {
  54. APIS.openWhiteboard()
  55. }
  56. }
  57. @objc func openNotificationCenter() {
  58. print("openNotificationCenter")
  59. DispatchQueue.main.async {
  60. APIS.openNotificationCenter()
  61. }
  62. }
  63. @objc(openContactCenterChat:)
  64. func openContactCenterChat(category: Int) {
  65. print("openContactCenterChat \(category)")
  66. DispatchQueue.main.async {
  67. APIS.openContactCenter(media: 0, category: category)
  68. }
  69. }
  70. @objc(openContactCenterAudioCall:)
  71. func openContactCenterAudioCall(category: Int) {
  72. print("openContactCenterAudioCall")
  73. DispatchQueue.main.async {
  74. APIS.openContactCenter(media: 1, category: category)
  75. }
  76. }
  77. @objc(openContactCenterVideoCall:)
  78. func openContactCenterVideoCall(category: Int) {
  79. print("openContactCenterVideoCall")
  80. DispatchQueue.main.async {
  81. APIS.openContactCenter(media: 2, category: category)
  82. }
  83. }
  84. @objc(signInAdmin:)
  85. func signInAdmin(pwd: String) {
  86. print("signInAdmin")
  87. DispatchQueue.main.async {
  88. APIS.signInAdmin(password: pwd)
  89. }
  90. }
  91. @objc func openSetOfficer() {
  92. print("openSetOfficer")
  93. DispatchQueue.main.async {
  94. APIS.openSetAsOfficerForm()
  95. }
  96. }
  97. @objc func openProfile() {
  98. print("openProfile")
  99. DispatchQueue.main.async {
  100. APIS.openProfile()
  101. }
  102. }
  103. }