@capgo/capacitor-stream-call 0.0.66 → 0.0.67
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.
|
@@ -155,14 +155,42 @@ public class StreamCallPlugin : Plugin() {
|
|
|
155
155
|
activity.startService(serviceIntent)
|
|
156
156
|
android.util.Log.d("StreamCallPlugin", "Started StreamCallBackgroundService to keep app alive")
|
|
157
157
|
|
|
158
|
-
// Handle
|
|
159
|
-
activity?.intent
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
158
|
+
// Handle intents, but avoid processing the same intent twice
|
|
159
|
+
val currentIntent = activity?.intent
|
|
160
|
+
val savedIntent = pendingIntent
|
|
161
|
+
|
|
162
|
+
// Check if both intents are the same (common when app is killed and restarted)
|
|
163
|
+
val areSameIntent = currentIntent != null && savedIntent != null &&
|
|
164
|
+
currentIntent.action == savedIntent.action &&
|
|
165
|
+
try {
|
|
166
|
+
val currentCid = currentIntent.streamCallId(NotificationHandler.INTENT_EXTRA_CALL_CID)
|
|
167
|
+
val savedCid = savedIntent.streamCallId(NotificationHandler.INTENT_EXTRA_CALL_CID)
|
|
168
|
+
currentCid?.cid == savedCid?.cid
|
|
169
|
+
} catch (e: Exception) {
|
|
170
|
+
android.util.Log.w("StreamCallPlugin", "Error comparing call CIDs: ${e.message}")
|
|
171
|
+
false
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
when {
|
|
175
|
+
areSameIntent -> {
|
|
176
|
+
android.util.Log.d("StreamCallPlugin", "Current intent and saved intent are identical, processing only once")
|
|
177
|
+
if (currentIntent != null) {
|
|
178
|
+
handleOnNewIntent(currentIntent)
|
|
179
|
+
}
|
|
180
|
+
pendingIntent = null // Clear to prevent double processing
|
|
181
|
+
}
|
|
182
|
+
savedIntent != null -> {
|
|
183
|
+
android.util.Log.d("StreamCallPlugin", "Processing saved initial intent")
|
|
184
|
+
handleOnNewIntent(savedIntent)
|
|
185
|
+
pendingIntent = null
|
|
186
|
+
}
|
|
187
|
+
currentIntent != null -> {
|
|
188
|
+
android.util.Log.d("StreamCallPlugin", "Processing current activity intent")
|
|
189
|
+
handleOnNewIntent(currentIntent)
|
|
190
|
+
}
|
|
191
|
+
else -> {
|
|
192
|
+
android.util.Log.d("StreamCallPlugin", "No intents to process")
|
|
193
|
+
}
|
|
166
194
|
}
|
|
167
195
|
}
|
|
168
196
|
|
|
@@ -240,6 +268,12 @@ public class StreamCallPlugin : Plugin() {
|
|
|
240
268
|
android.util.Log.d("StreamCallPlugin", "handleOnNewIntent: ACCEPT_CALL - Accepting call with cid: $cid")
|
|
241
269
|
val call = streamVideoClient?.call(id = cid.id, type = cid.type)
|
|
242
270
|
if (call != null) {
|
|
271
|
+
// Log the full stack trace to see exactly where this is called from
|
|
272
|
+
val stackTrace = Thread.currentThread().stackTrace
|
|
273
|
+
android.util.Log.d("StreamCallPlugin", "internalAcceptCall STACK TRACE:")
|
|
274
|
+
stackTrace.forEachIndexed { index, element ->
|
|
275
|
+
android.util.Log.d("StreamCallPlugin", " [$index] ${element.className}.${element.methodName}(${element.fileName}:${element.lineNumber})")
|
|
276
|
+
}
|
|
243
277
|
kotlinx.coroutines.GlobalScope.launch {
|
|
244
278
|
internalAcceptCall(call)
|
|
245
279
|
}
|
|
@@ -989,6 +1023,7 @@ public class StreamCallPlugin : Plugin() {
|
|
|
989
1023
|
@OptIn(DelicateCoroutinesApi::class, InternalStreamVideoApi::class)
|
|
990
1024
|
internal fun internalAcceptCall(call: Call) {
|
|
991
1025
|
android.util.Log.d("StreamCallPlugin", "internalAcceptCall: Entered for call: ${call.id}")
|
|
1026
|
+
|
|
992
1027
|
kotlinx.coroutines.GlobalScope.launch {
|
|
993
1028
|
try {
|
|
994
1029
|
android.util.Log.d("StreamCallPlugin", "internalAcceptCall: Coroutine started for call ${call.id}")
|
package/package.json
CHANGED