@capgo/capacitor-stream-call 0.0.35 → 0.0.37

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 (2) hide show
  1. package/README.md +45 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -6,8 +6,7 @@
6
6
  <h2><a href="https://capgo.app/consulting/?ref=plugin"> Fix your annoying bug now, Hire a Capacitor expert 💪</a></h2>
7
7
  </div>
8
8
 
9
- WIP: We are actively working on this plugin. not yet ready for production.
10
- Uses the https://getstream.io/ SDK to implement calling in Capacitor
9
+ Uses the https://getstream.io/ native SDK to implement calling in Capacitor
11
10
 
12
11
  ## Install
13
12
 
@@ -117,6 +116,50 @@ You can find all available localization keys in the [StreamVideo SDK repository]
117
116
 
118
117
  The SDK will automatically use the system language and these translations.
119
118
 
119
+ To receive all on Android from lockscreen you need to listen to specific event `incomingCall`:
120
+
121
+ Here is one exemple in angular from our demo app:
122
+
123
+ ```ts
124
+ StreamCall.addListener('incomingCall', async (payload: any) => {
125
+ console.log('[incomingCall] lock-screen payload', payload);
126
+ this.incomingCallId = payload.cid;
127
+ this.isLockscreenIncoming = true;
128
+ this.cdr.detectChanges();
129
+ });
130
+ ```
131
+ This will allow you to display a custom call screen and then enter or reject the call with :
132
+
133
+ ```ts
134
+ async acceptCall() {
135
+ if (!this.incomingCallId) return;
136
+
137
+ try {
138
+ await StreamCall.acceptCall();
139
+ await this.presentToast('Call accepted', 'success');
140
+ } catch (error) {
141
+ console.error('Failed to accept call:', error);
142
+ await this.presentToast('Failed to accept call', 'danger');
143
+ }
144
+ }
145
+
146
+ async rejectCall() {
147
+ if (!this.incomingCallId) return;
148
+
149
+ try {
150
+ await StreamCall.rejectCall();
151
+ this.incomingCallId = null;
152
+ await this.presentToast('Call rejected', 'success');
153
+ } catch (error) {
154
+ console.error('Failed to reject call:', error);
155
+ await this.presentToast('Failed to reject call', 'danger');
156
+ }
157
+ }
158
+ ```
159
+ This is the only way we found to allow the app to use the same UI when phone is lock for the video call.
160
+ This can be done that way only on Android on IOS this part is handle by the OS.
161
+
162
+
120
163
  ## API
121
164
 
122
165
  <docgen-index>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-stream-call",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "description": "Uses the https://getstream.io/ SDK to implement calling in Capacitor",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",