@qusaieilouti99/call-manager 0.1.5 → 0.1.7

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.
@@ -25,6 +25,8 @@ class CallManagerModule(reactContext: ReactApplicationContext) :
25
25
  const val PHONE_ACCOUNT_ID = "com.qusaieilouti99.callmanager.SELF_MANAGED"
26
26
  }
27
27
 
28
+
29
+ private val notificationHelper by lazy { CallNotificationHelper(reactApplicationContext) }
28
30
  private var currentCallId: String? = null
29
31
  private var eventHandler: Callback? = null
30
32
 
@@ -43,6 +45,17 @@ class CallManagerModule(reactContext: ReactApplicationContext) :
43
45
  // 1. Report incoming call
44
46
  override fun reportIncomingCall(callId: String, callData: String) {
45
47
  Log.d(TAG, "reportIncomingCall called with callId=$callId, callData=$callData")
48
+ // Parse caller name from callData (or use a default)
49
+ val callerName = try {
50
+ val json = org.json.JSONObject(callData)
51
+ json.optString("name", "Unknown")
52
+ } catch (e: Exception) {
53
+ "Unknown"
54
+ }
55
+
56
+ // Show incoming call notification and play ringtone
57
+ notificationHelper.showIncomingCallNotification(callId, callerName)
58
+
46
59
  val context = reactApplicationContext
47
60
  val telecomManager = context.getSystemService(Context.TELECOM_SERVICE) as TelecomManager
48
61
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qusaieilouti99/call-manager",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "call manager",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",