@qusaieilouti99/call-manager 0.1.32 → 0.1.33

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.
@@ -59,6 +59,8 @@ object CallEngine {
59
59
  eventHandler?.invoke(type, data.toString())
60
60
  }
61
61
 
62
+ fun getAppContext(): Context? = appContext
63
+
62
64
  // --- Public API ---
63
65
 
64
66
  fun setCanMakeMultipleCalls(allow: Boolean) {
@@ -9,25 +9,25 @@ class CallManager : HybridCallManagerSpec() {
9
9
  private var currentListener: ((CallEventType, String) -> Unit)? = null
10
10
 
11
11
  override fun endCall(callId: String) {
12
- CallEngine.endCall(CallEngine.appContext ?: return, callId)
12
+ CallEngine.endCall(CallEngine.getAppContext() ?: return, callId)
13
13
  }
14
14
 
15
15
  override fun silenceRingtone() {
16
- CallEngine.cancelIncomingCallUI(CallEngine.appContext ?: return)
16
+ CallEngine.cancelIncomingCallUI(CallEngine.getAppContext() ?: return)
17
17
  }
18
18
 
19
19
  override fun getAudioDevices(): Array<String> {
20
- val context = CallEngine.appContext ?: throw IllegalStateException("App context not set")
20
+ val context = CallEngine.getAppContext() ?: throw IllegalStateException("App context not set")
21
21
  return CallEngine.getAudioDevices(context).toTypedArray()
22
22
  }
23
23
 
24
24
  override fun setAudioRoute(route: String) {
25
- val context = CallEngine.appContext ?: throw IllegalStateException("App context not set")
25
+ val context = CallEngine.getAppContext() ?: throw IllegalStateException("App context not set")
26
26
  CallEngine.setAudioRoute(context, route)
27
27
  }
28
28
 
29
29
  override fun keepScreenAwake(keepAwake: Boolean) {
30
- val context = CallEngine.appContext ?: throw IllegalStateException("App context not set")
30
+ val context = CallEngine.getAppContext() ?: throw IllegalStateException("App context not set")
31
31
  CallEngine.keepScreenAwake(context, keepAwake)
32
32
  }
33
33
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qusaieilouti99/call-manager",
3
- "version": "0.1.32",
3
+ "version": "0.1.33",
4
4
  "description": "Call manager",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",