rns-nativecall 0.7.0 → 0.7.1

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.
@@ -26,15 +26,29 @@ class CallMessagingService : FirebaseMessagingService() {
26
26
  val type = data["type"] ?: ""
27
27
 
28
28
  if (type == "CANCEL") {
29
- NativeCallManager.stopRingtone()
30
- CallState.markCanceled(uuid)
31
- // Gate future headless runs for this UUID
32
- if (CallState.getCurrent() == uuid) {
33
- CallState.clear(uuid)
34
- }
35
- showMissedCallNotification(context, data, uuid)
36
- return
37
- }
29
+ NativeCallManager.stopRingtone()
30
+ CallState.markCanceled(uuid)
31
+
32
+ try {
33
+ // Direct disk-level cleanup of AsyncStorage
34
+ val prefs = context.getSharedPreferences("RKStorage", Context.MODE_PRIVATE)
35
+ prefs.edit()
36
+ .remove("pending_call_uuid")
37
+ .remove("offer_$uuid")
38
+ .apply()
39
+
40
+ // Kill the 'Connecting...' service if it's visible
41
+ context.stopService(Intent(context, CallForegroundService::class.java))
42
+ } catch (e: Exception) {
43
+ e.printStackTrace()
44
+ }
45
+
46
+ if (CallState.getCurrent() == uuid) {
47
+ CallState.clear(uuid)
48
+ }
49
+ showMissedCallNotification(context, data, uuid)
50
+ return
51
+ }
38
52
 
39
53
  // Inside onMessageReceived
40
54
  if (!CallState.setCurrent(uuid)) {
@@ -51,4 +51,5 @@ object CallState {
51
51
  currentUuid = null
52
52
  canceledUuids.clear()
53
53
  }
54
- }
54
+ }
55
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rns-nativecall",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "High-performance React Native module for handling native VoIP call UI on Android and iOS.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",