edoctor-sendbird-calls 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +33 -0
  3. package/android/build.gradle +82 -0
  4. package/android/gradle.properties +5 -0
  5. package/android/src/main/AndroidManifest.xml +34 -0
  6. package/android/src/main/AndroidManifestNew.xml +2 -0
  7. package/android/src/main/java/com/edoctorsendbirdcalls/ComingCallActivity.java +41 -0
  8. package/android/src/main/java/com/edoctorsendbirdcalls/RNSendBirdCallsModule.java +2068 -0
  9. package/android/src/main/java/com/edoctorsendbirdcalls/RNSendBirdCallsPackage.java +32 -0
  10. package/android/src/main/java/com/edoctorsendbirdcalls/RNVSendBirdCallsVideo.java +10 -0
  11. package/android/src/main/java/com/edoctorsendbirdcalls/RNVSendBirdCallsVideoManager.java +77 -0
  12. package/android/src/main/java/com/edoctorsendbirdcalls/RNVideoViewGroup.java +109 -0
  13. package/android/src/main/java/com/edoctorsendbirdcalls/SharedUtils.java +127 -0
  14. package/android/src/main/java/com/edoctorsendbirdcalls/VcCallReceiver.java +37 -0
  15. package/android/src/main/java/com/edoctorsendbirdcalls/VcHeadlessService.java +23 -0
  16. package/android/src/main/java/com/edoctorsendbirdcalls/VoIPBaseService.java +100 -0
  17. package/android/src/main/java/com/edoctorsendbirdcalls/VoIPService.java +164 -0
  18. package/android/src/main/java/com/edoctorsendbirdcalls/XiaomiUtilities.java +75 -0
  19. package/android/src/main/res/drawable/bar_selector_white.xml +18 -0
  20. package/android/src/main/res/drawable/button_answer.xml +8 -0
  21. package/android/src/main/res/drawable/button_reject.xml +8 -0
  22. package/android/src/main/res/drawable/call_notification_line.xml +8 -0
  23. package/android/src/main/res/drawable/ic_answer.xml +5 -0
  24. package/android/src/main/res/drawable/ic_call_notification_answer.xml +6 -0
  25. package/android/src/main/res/drawable/ic_call_notification_decline.xml +9 -0
  26. package/android/src/main/res/drawable/ic_reject.xml +5 -0
  27. package/android/src/main/res/drawable/rn_edit_text_material.xml +36 -0
  28. package/android/src/main/res/layout/call_notification.xml +124 -0
  29. package/edoctor-sendbird-calls.podspec +27 -0
  30. package/ios/CXCallManager.swift +211 -0
  31. package/ios/CXProvider.swift +38 -0
  32. package/ios/Extensions/UIKit/UIColor.swift +30 -0
  33. package/ios/Extensions/UIKit/UIView+Extension.swift +61 -0
  34. package/ios/Extensions/UIKit/UIViewController.swift +28 -0
  35. package/ios/PrivacyInfo.xcprivacy +47 -0
  36. package/ios/RNSendBirdCalls-Bridging-Header.h +3 -0
  37. package/ios/RNSendBirdCalls.mm +94 -0
  38. package/ios/RNSendBirdCalls.swift +549 -0
  39. package/ios/RNSendBirdCallsHelper.swift +28 -0
  40. package/ios/RNVSendBirdCallsVideo.swift +55 -0
  41. package/ios/RNVSendBirdCallsVideoManager.mm +6 -0
  42. package/ios/RNVSendBirdCallsVideoManager.swift +15 -0
  43. package/ios/SendBirdCallsExtentions.swift +46 -0
  44. package/lib/module/SendBirdCalls.js +377 -0
  45. package/lib/module/SendBirdCalls.js.map +1 -0
  46. package/lib/module/SendBirdCallsEvents.js +108 -0
  47. package/lib/module/SendBirdCallsEvents.js.map +1 -0
  48. package/lib/module/SendBirdCallsVideo.js +33 -0
  49. package/lib/module/SendBirdCallsVideo.js.map +1 -0
  50. package/lib/module/index.js +14 -0
  51. package/lib/module/index.js.map +1 -0
  52. package/lib/module/index.type.js +2 -0
  53. package/lib/module/index.type.js.map +1 -0
  54. package/lib/module/package.json +1 -0
  55. package/lib/typescript/package.json +1 -0
  56. package/lib/typescript/src/SendBirdCalls.d.ts +63 -0
  57. package/lib/typescript/src/SendBirdCalls.d.ts.map +1 -0
  58. package/lib/typescript/src/SendBirdCallsEvents.d.ts +36 -0
  59. package/lib/typescript/src/SendBirdCallsEvents.d.ts.map +1 -0
  60. package/lib/typescript/src/SendBirdCallsVideo.d.ts +18 -0
  61. package/lib/typescript/src/SendBirdCallsVideo.d.ts.map +1 -0
  62. package/lib/typescript/src/index.d.ts +5 -0
  63. package/lib/typescript/src/index.d.ts.map +1 -0
  64. package/lib/typescript/src/index.type.d.ts +14 -0
  65. package/lib/typescript/src/index.type.d.ts.map +1 -0
  66. package/package.json +154 -0
  67. package/src/SendBirdCalls.ts +472 -0
  68. package/src/SendBirdCallsEvents.ts +141 -0
  69. package/src/SendBirdCallsVideo.tsx +44 -0
  70. package/src/index.tsx +11 -0
  71. package/src/index.type.ts +20 -0
@@ -0,0 +1,61 @@
1
+ //
2
+ // UIView+Extension.swift
3
+ // QuickStart
4
+ //
5
+ // Created by Jaesung Lee on 2020/03/09.
6
+ // Copyright © 2020 Sendbird Inc. All rights reserved.
7
+ //
8
+
9
+ import UIKit
10
+ import SendBirdCalls
11
+
12
+ // MARK: For Video View
13
+ extension UIView {
14
+ func embed(_ videoView: SendBirdVideoView) {
15
+ self.insertSubview(videoView, at: 0)
16
+ videoView.translatesAutoresizingMaskIntoConstraints = false
17
+ self.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[view]|",
18
+ options: [],
19
+ metrics: nil,
20
+ views: ["view": videoView]))
21
+
22
+ self.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[view]|",
23
+ options: [],
24
+ metrics: nil,
25
+ views: ["view": videoView]))
26
+ self.layoutIfNeeded()
27
+ }
28
+ }
29
+
30
+ // MARK: For Storyboard
31
+ extension UIView {
32
+ @IBInspectable var cornerRadius: CGFloat {
33
+ get {
34
+ layer.cornerRadius
35
+ }
36
+ set {
37
+ layer.cornerRadius = newValue
38
+ if newValue > 0 {
39
+ self.clipsToBounds = true
40
+ }
41
+ }
42
+ }
43
+
44
+ @IBInspectable var borderWidth: CGFloat {
45
+ get {
46
+ layer.borderWidth
47
+ }
48
+ set {
49
+ layer.borderWidth = newValue
50
+ }
51
+ }
52
+
53
+ @IBInspectable var borderColor: UIColor? {
54
+ get {
55
+ layer.borderColor.map(UIColor.init)
56
+ }
57
+ set {
58
+ layer.borderColor = newValue?.cgColor
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,28 @@
1
+ //
2
+ // UIViewController+QuickStart.swift
3
+ // SendBirdCall Tester
4
+ //
5
+ // Copyright © 2020 Sendbird, Inc. All rights reserved.
6
+ //
7
+
8
+ import UIKit
9
+
10
+ extension UIViewController {
11
+ static var topViewController: UIViewController? {
12
+ if var topController = UIApplication.shared.keyWindow?.rootViewController {
13
+ while let presentedViewController = topController.presentedViewController {
14
+ topController = presentedViewController
15
+ }
16
+ return topController
17
+ } else {
18
+ return nil
19
+ }
20
+ }
21
+
22
+ func presentErrorAlert(message: String, closeHandler: ((UIAlertAction) -> Void)? = nil) {
23
+ let alert = UIAlertController(title: "Error", message: message, preferredStyle: .alert)
24
+ let actionDone = UIAlertAction(title: "Done", style: .cancel, handler: closeHandler)
25
+ alert.addAction(actionDone)
26
+ self.present(alert, animated: true, completion: nil)
27
+ }
28
+ }
@@ -0,0 +1,47 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+
4
+ <plist version="1.0">
5
+ <dict>
6
+ <key>NSPrivacyCollectedDataTypes</key>
7
+ <array>
8
+ </array>
9
+ <key>NSPrivacyAccessedAPITypes</key>
10
+ <array>
11
+ <dict>
12
+ <key>NSPrivacyAccessedAPIType</key>
13
+ <string>NSPrivacyAccessedAPICategoryDiskSpace</string>
14
+ <key>NSPrivacyAccessedAPITypeReasons</key>
15
+ <array>
16
+ <string>E174.1</string>
17
+ </array>
18
+ </dict>
19
+ <dict>
20
+ <key>NSPrivacyAccessedAPIType</key>
21
+ <string>NSPrivacyAccessedAPICategorySystemBootTime</string>
22
+ <key>NSPrivacyAccessedAPITypeReasons</key>
23
+ <array>
24
+ <string>35F9.1</string>
25
+ </array>
26
+ </dict>
27
+ <dict>
28
+ <key>NSPrivacyAccessedAPIType</key>
29
+ <string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
30
+ <key>NSPrivacyAccessedAPITypeReasons</key>
31
+ <array>
32
+ <string>C617.1</string>
33
+ </array>
34
+ </dict>
35
+ <dict>
36
+ <key>NSPrivacyAccessedAPIType</key>
37
+ <string>NSPrivacyAccessedAPICategoryUserDefaults</string>
38
+ <key>NSPrivacyAccessedAPITypeReasons</key>
39
+ <array>
40
+ <string>CA92.1</string>
41
+ </array>
42
+ </dict>
43
+ </array>
44
+ <key>NSPrivacyTracking</key>
45
+ <false/>
46
+ </dict>
47
+ </plist>
@@ -0,0 +1,3 @@
1
+ #import <React/RCTBridgeModule.h>
2
+ #import "React/RCTEventEmitter.h"
3
+ #import <React/RCTViewManager.h>
@@ -0,0 +1,94 @@
1
+ // RNSendBirdCalls.m
2
+ #import <React/RCTBridgeModule.h>
3
+ #import <React/RCTEventEmitter.h>
4
+
5
+ @interface RCT_EXTERN_MODULE(RNSendBirdCalls, RCTEventEmitter)
6
+
7
+ // Authentication
8
+ RCT_EXTERN_METHOD(authenticate:(NSString *)userId
9
+ accessToken:(NSString *)accessToken
10
+ resolve:(RCTPromiseResolveBlock)resolve
11
+ reject:(RCTPromiseRejectBlock)reject)
12
+
13
+ RCT_EXTERN_METHOD(deAuthenticate:(RCTPromiseResolveBlock)resolve
14
+ rejecter:(RCTPromiseRejectBlock)reject)
15
+
16
+ RCT_EXTERN_METHOD(initSendBird:(NSString *)appId
17
+ resolve:(RCTPromiseResolveBlock)resolve
18
+ reject:(RCTPromiseRejectBlock)reject)
19
+
20
+ // Call Management
21
+ RCT_EXTERN_METHOD(dial:(NSString *)calleeId
22
+ isVideoCall:(BOOL)isVideoCall
23
+ isVideoEnable:(BOOL)isVideoEnable
24
+ isAudioEnable:(BOOL)isAudioEnable
25
+ appointmentScheduleId:(NSString *)appointmentScheduleId
26
+ eClinicId:(NSString *)eClinicId
27
+ resolve:(RCTPromiseResolveBlock)resolve
28
+ reject:(RCTPromiseRejectBlock)reject)
29
+
30
+ RCT_EXTERN_METHOD(endCall:(RCTPromiseResolveBlock)resolve
31
+ reject:(RCTPromiseRejectBlock)reject)
32
+
33
+ RCT_EXTERN_METHOD(acceptCall:(NSString *)callId
34
+ isVideoEnable:(BOOL)isVideoEnable
35
+ isAudioEnable:(BOOL)isAudioEnable
36
+ resolve:(RCTPromiseResolveBlock)resolve
37
+ reject:(RCTPromiseRejectBlock)reject)
38
+
39
+ RCT_EXTERN_METHOD(endAllCalls:(RCTPromiseResolveBlock)resolve
40
+ rejecter:(RCTPromiseRejectBlock)reject)
41
+
42
+ RCT_EXTERN_METHOD(getOngoingCalls:(RCTPromiseResolveBlock)resolve
43
+ rejecter:(RCTPromiseRejectBlock)reject)
44
+
45
+ // Audio/Video Controls
46
+ RCT_EXTERN_METHOD(muteMicrophone:(RCTPromiseResolveBlock)resolve
47
+ rejecter:(RCTPromiseRejectBlock)reject)
48
+
49
+ RCT_EXTERN_METHOD(unmuteMicrophone:(RCTPromiseResolveBlock)resolve
50
+ rejecter:(RCTPromiseRejectBlock)reject)
51
+
52
+ RCT_EXTERN_METHOD(startVideo:(RCTPromiseResolveBlock)resolve
53
+ rejecter:(RCTPromiseRejectBlock)reject)
54
+
55
+ RCT_EXTERN_METHOD(stopVideo:(RCTPromiseResolveBlock)resolve
56
+ rejecter:(RCTPromiseRejectBlock)reject)
57
+
58
+ RCT_EXTERN_METHOD(switchCamera:(RCTPromiseResolveBlock)resolve
59
+ rejecter:(RCTPromiseRejectBlock)reject)
60
+
61
+ // Recording
62
+ RCT_EXTERN_METHOD(startRecording:(NSString *)fileName
63
+ isRemote:(BOOL)isRemote
64
+ resolve:(RCTPromiseResolveBlock)resolve
65
+ rejecter:(RCTPromiseRejectBlock)reject)
66
+
67
+ RCT_EXTERN_METHOD(stopRecording:(NSString *)recordingId
68
+ isVideoCall:(BOOL)isVideoCall
69
+ resolve:(RCTPromiseResolveBlock)resolve
70
+ reject:(RCTPromiseRejectBlock)reject)
71
+
72
+ // Configuration
73
+ RCT_EXTERN_METHOD(voipRegistry)
74
+
75
+ RCT_EXTERN_METHOD(addDirectCallSound:(NSString *)soundType
76
+ filename:(NSString *)filename)
77
+
78
+ RCT_EXTERN_METHOD(setDirectCallDialingSoundOnWhenSilentMode:(BOOL)isEnabled)
79
+
80
+ RCT_EXTERN_METHOD(shareStorage:(NSString *)appId)
81
+
82
+ // Event Management
83
+ RCT_EXTERN_METHOD(setNativeEvent:(NSString *)event)
84
+
85
+ RCT_EXTERN_METHOD(removeNativeEvent:(NSString *)event)
86
+
87
+ RCT_EXTERN_METHOD(removeAllEvents)
88
+
89
+ + (BOOL)requiresMainQueueSetup
90
+ {
91
+ return YES;
92
+ }
93
+
94
+ @end