edoctor-sendbird-calls 1.1.0-beta.0 → 1.1.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.
- package/README.md +48 -82
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,134 +4,100 @@ React Native module for Sendbird Calls SDK.
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
### 1. Install the npm package
|
|
8
|
-
|
|
9
7
|
```sh
|
|
10
8
|
yarn add edoctor-sendbird-calls
|
|
11
|
-
# or
|
|
12
|
-
npm install edoctor-sendbird-calls
|
|
13
9
|
```
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
SendBirdCalls SDK is delivered via Swift Package Manager. The React Native bridge still comes from this pod.
|
|
18
|
-
|
|
19
|
-
**Steps**
|
|
20
|
-
1) `cd ios && pod install`
|
|
21
|
-
2) Open your `.xcworkspace` in Xcode.
|
|
22
|
-
3) Add the SPM package: File → Add Package Dependencies… → `https://github.com/sendbird/sendbird-calls-ios` → version **1.11.1** or later.
|
|
23
|
-
4) In the “Add to Target” column, select **both**:
|
|
24
|
-
- Your app target (e.g. `EdoctorSendbirdCallsExample`).
|
|
25
|
-
- The pod target `edoctor-sendbird-calls` (Pods project). If it is not offered, add the package first to the workspace, then go to Pods.xcodeproj → target `edoctor-sendbird-calls` → Build Phases → Link Binary With Libraries → `+` → pick `SendBirdCalls`.
|
|
26
|
-
5) Ensure `SendBirdCalls.framework` is in Link Binary With Libraries for both targets and set to **Do Not Embed**.
|
|
11
|
+
## iOS Setup
|
|
27
12
|
|
|
28
|
-
|
|
13
|
+
**Requirements:** iOS 14.0+, Xcode 15.0+, CocoaPods 1.10.0+
|
|
29
14
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
2. Go to **File** → **Add Package Dependencies...**.
|
|
35
|
-
3. Enter the package URL: `https://github.com/sendbird/sendbird-calls-ios`.
|
|
36
|
-
4. Select version **1.11.1** or later.
|
|
37
|
-
5. Click **Add Package**.
|
|
38
|
-
6. Select your main app target and click **Add Package**.
|
|
15
|
+
### 1. Install Pod
|
|
16
|
+
```sh
|
|
17
|
+
cd ios && pod install
|
|
18
|
+
```
|
|
39
19
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
20
|
+
### 2. Add SendBirdCalls via SPM
|
|
21
|
+
1. Open `.xcworkspace` in Xcode
|
|
22
|
+
2. **File** → **Add Package Dependencies**
|
|
23
|
+
3. URL: `https://github.com/sendbird/sendbird-calls-ios`
|
|
24
|
+
4. Version: **1.11.1** or later
|
|
25
|
+
5. Add to **both** your app target and `edoctor-sendbird-calls` pod target
|
|
26
|
+
6. Set framework to **Do Not Embed** in both targets
|
|
44
27
|
|
|
45
|
-
|
|
46
|
-
This library includes a `PrivacyInfo.xcprivacy` file as required by Apple.
|
|
28
|
+
> **Note:** After `pod install`, verify the pod target still links `SendBirdCalls` framework.
|
|
47
29
|
|
|
48
|
-
|
|
49
|
-
Add these keys to your `Info.plist`:
|
|
30
|
+
### 3. Configure Permissions
|
|
50
31
|
|
|
32
|
+
**Info.plist:**
|
|
51
33
|
```xml
|
|
52
34
|
<key>NSMicrophoneUsageDescription</key>
|
|
53
|
-
<string>$(PRODUCT_NAME) needs access
|
|
35
|
+
<string>$(PRODUCT_NAME) needs microphone access for voice calls</string>
|
|
54
36
|
<key>NSCameraUsageDescription</key>
|
|
55
|
-
<string>$(PRODUCT_NAME) needs access
|
|
37
|
+
<string>$(PRODUCT_NAME) needs camera access for video calls</string>
|
|
56
38
|
```
|
|
57
39
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
-
|
|
40
|
+
**Background Modes:**
|
|
41
|
+
Xcode → **Signing & Capabilities** → **+ Capability** → **Background Modes**
|
|
42
|
+
Enable:
|
|
43
|
+
- Audio, AirPlay, and Picture in Picture
|
|
44
|
+
- Voice over IP
|
|
62
45
|
|
|
63
|
-
|
|
46
|
+
## Android Setup
|
|
64
47
|
|
|
65
|
-
|
|
48
|
+
Ensure `minSdkVersion >= 24` in `android/build.gradle`.
|
|
66
49
|
|
|
67
50
|
## Usage
|
|
68
51
|
|
|
69
|
-
###
|
|
52
|
+
### Initialize & Authenticate
|
|
70
53
|
|
|
71
54
|
```javascript
|
|
72
55
|
import { SendBirdCalls } from 'edoctor-sendbird-calls';
|
|
73
56
|
|
|
74
|
-
// Initialize
|
|
75
57
|
await SendBirdCalls.initSendBird('YOUR_APP_ID');
|
|
76
|
-
|
|
77
|
-
// Authenticate
|
|
78
58
|
const result = await SendBirdCalls.authenticate(userId, accessToken);
|
|
79
|
-
if (result.succeeded) {
|
|
80
|
-
console.log('User authenticated:', result.userId);
|
|
81
|
-
}
|
|
82
59
|
```
|
|
83
60
|
|
|
84
|
-
###
|
|
61
|
+
### Make a Call
|
|
85
62
|
|
|
86
63
|
```javascript
|
|
87
|
-
// Dial a call
|
|
88
64
|
const dialResult = await SendBirdCalls.dial(
|
|
89
|
-
targetUserId,
|
|
90
|
-
isVideoCall,
|
|
91
|
-
|
|
92
|
-
|
|
65
|
+
targetUserId,
|
|
66
|
+
isVideoCall, // boolean
|
|
67
|
+
isVideoEnabled, // boolean
|
|
68
|
+
isAudioEnabled // boolean
|
|
93
69
|
);
|
|
94
|
-
|
|
95
|
-
if (dialResult.succeeded) {
|
|
96
|
-
console.log('Call started with ID:', dialResult.callId);
|
|
97
|
-
}
|
|
98
70
|
```
|
|
99
71
|
|
|
100
|
-
###
|
|
72
|
+
### Handle Events
|
|
101
73
|
|
|
102
74
|
```javascript
|
|
103
75
|
import { SendBirdCallsEvents } from 'edoctor-sendbird-calls';
|
|
104
76
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
ringingListener.remove();
|
|
120
|
-
connectedListener.remove();
|
|
121
|
-
endedListener.remove();
|
|
122
|
-
};
|
|
123
|
-
}, []);
|
|
77
|
+
const ringingListener = SendBirdCallsEvents.listenerRinging((data) => {
|
|
78
|
+
console.log('Incoming call:', data.callId);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const connectedListener = SendBirdCallsEvents.listenerConnected((data) => {
|
|
82
|
+
console.log('Call connected');
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const endedListener = SendBirdCallsEvents.listenerEnded((data) => {
|
|
86
|
+
console.log('Call ended');
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// Cleanup
|
|
90
|
+
ringingListener.remove();
|
|
124
91
|
```
|
|
125
92
|
|
|
126
|
-
###
|
|
93
|
+
### Video Component
|
|
127
94
|
|
|
128
95
|
```javascript
|
|
129
96
|
import { SendBirdCallsVideo } from 'edoctor-sendbird-calls';
|
|
130
97
|
|
|
131
|
-
// In your render function
|
|
132
98
|
<SendBirdCallsVideo
|
|
133
99
|
callId={callId}
|
|
134
|
-
local={false}
|
|
100
|
+
local={false} // false: remote, true: local preview
|
|
135
101
|
style={{ flex: 1 }}
|
|
136
102
|
/>
|
|
137
103
|
```
|