Selaa lähdekoodia

feat(iOS): callkit objc implementation

factor2
Alex Bumbu 2 vuotta sitten
vanhempi
commit
e68ede65e1
No account linked to committer's email address

+ 32
- 26
ios/sdk/sdk.xcodeproj/project.pbxproj Näytä tiedosto

@@ -23,6 +23,16 @@
23 23
 		0BCA49611EC4B6C600B793EE /* Proximity.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BCA495E1EC4B6C600B793EE /* Proximity.m */; };
24 24
 		0BD906EA1EC0C00300C8C18E /* JitsiMeet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BD906E81EC0C00300C8C18E /* JitsiMeet.h */; settings = {ATTRIBUTES = (Public, ); }; };
25 25
 		3453F4A32680898C4A40E821 /* libPods-JitsiMeetSDK.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 927ED7DF018DE5E12C4C3404 /* libPods-JitsiMeetSDK.a */; };
26
+		4E0EF63028CA2FB3005D1B03 /* JMCallKitEmitter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E0EF62E28CA2FB3005D1B03 /* JMCallKitEmitter.h */; };
27
+		4E0EF63128CA2FB3005D1B03 /* JMCallKitEmitter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E0EF62E28CA2FB3005D1B03 /* JMCallKitEmitter.h */; };
28
+		4E0EF63228CA2FB3005D1B03 /* JMCallKitEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E0EF62F28CA2FB3005D1B03 /* JMCallKitEmitter.m */; };
29
+		4E0EF63328CA2FB3005D1B03 /* JMCallKitEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E0EF62F28CA2FB3005D1B03 /* JMCallKitEmitter.m */; };
30
+		4E0EF63528CA317E005D1B03 /* JMCallKitListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E0EF63428CA317E005D1B03 /* JMCallKitListener.h */; settings = {ATTRIBUTES = (Public, ); }; };
31
+		4E0EF63628CA317E005D1B03 /* JMCallKitListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E0EF63428CA317E005D1B03 /* JMCallKitListener.h */; settings = {ATTRIBUTES = (Public, ); }; };
32
+		4E0EF63928CA4069005D1B03 /* JMCallKitProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E0EF63728CA4069005D1B03 /* JMCallKitProxy.h */; settings = {ATTRIBUTES = (Public, ); }; };
33
+		4E0EF63A28CA4069005D1B03 /* JMCallKitProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E0EF63728CA4069005D1B03 /* JMCallKitProxy.h */; settings = {ATTRIBUTES = (Public, ); }; };
34
+		4E0EF63B28CA4069005D1B03 /* JMCallKitProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E0EF63828CA4069005D1B03 /* JMCallKitProxy.m */; };
35
+		4E0EF63C28CA4069005D1B03 /* JMCallKitProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E0EF63828CA4069005D1B03 /* JMCallKitProxy.m */; };
26 36
 		4E51B76425E5345E0038575A /* ScheenshareEventEmiter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E51B76225E5345E0038575A /* ScheenshareEventEmiter.h */; };
27 37
 		4E51B76525E5345E0038575A /* ScheenshareEventEmiter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E51B76325E5345E0038575A /* ScheenshareEventEmiter.m */; };
28 38
 		4EBA6E61286072E300B31882 /* JitsiMeetViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 4EBA6E5F286072E300B31882 /* JitsiMeetViewController.h */; };
@@ -33,14 +43,11 @@
33 43
 		4ED4FFF42721B9B90074E620 /* JitsiAudioSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 4ED4FFF22721B9B90074E620 /* JitsiAudioSession.m */; };
34 44
 		4EEC9630286C73A2008705FA /* JitsiMeetView+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 4EEC962E286C73A2008705FA /* JitsiMeetView+Private.h */; };
35 45
 		4EEC9631286C73A2008705FA /* JitsiMeetView+Private.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EEC962F286C73A2008705FA /* JitsiMeetView+Private.m */; };
36
-		6F08DF7D4458EE3CF3F36F6D /* BuildFile in Frameworks */ = {isa = PBXBuildFile; };
46
+		6F08DF7D4458EE3CF3F36F6D /* (null) in Frameworks */ = {isa = PBXBuildFile; };
37 47
 		9A8EE79C77C17743BB66E8BD /* libPods-JitsiMeetSDKLite.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B46497DE9A95BDF5E312AF48 /* libPods-JitsiMeetSDKLite.a */; };
38 48
 		A4A934E9212F3ADB001E9388 /* Dropbox.m in Sources */ = {isa = PBXBuildFile; fileRef = A4A934E8212F3ADB001E9388 /* Dropbox.m */; };
39 49
 		C6245F5D2053091D0040BE68 /* image-resize@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C6245F5B2053091D0040BE68 /* image-resize@2x.png */; };
40 50
 		C6245F5E2053091D0040BE68 /* image-resize@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = C6245F5C2053091D0040BE68 /* image-resize@3x.png */; };
41
-		C69EFA0C209A0F660027712B /* JMCallKitEmitter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C69EFA09209A0F650027712B /* JMCallKitEmitter.swift */; };
42
-		C69EFA0D209A0F660027712B /* JMCallKitProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C69EFA0A209A0F660027712B /* JMCallKitProxy.swift */; };
43
-		C69EFA0E209A0F660027712B /* JMCallKitListener.swift in Sources */ = {isa = PBXBuildFile; fileRef = C69EFA0B209A0F660027712B /* JMCallKitListener.swift */; };
44 51
 		C6A34261204EF76800E062DD /* DragGestureController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6A3425E204EF76800E062DD /* DragGestureController.swift */; };
45 52
 		C6CC49AF207412CF000DFA42 /* PiPViewCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6CC49AE207412CF000DFA42 /* PiPViewCoordinator.swift */; };
46 53
 		C81E9AB925AC5AD800B134D9 /* ExternalAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = C81E9AB825AC5AD800B134D9 /* ExternalAPI.h */; };
@@ -49,8 +56,6 @@
49 56
 		DE438CDA2350934700DD541D /* JavaScriptSandbox.m in Sources */ = {isa = PBXBuildFile; fileRef = DE438CD82350934700DD541D /* JavaScriptSandbox.m */; };
50 57
 		DE65AACA2317FFCD00290BEC /* LogUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = DE65AAC92317FFCD00290BEC /* LogUtils.h */; };
51 58
 		DE65AACC2318028300290BEC /* JitsiMeetBaseLogHandler+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DE65AACB2318028300290BEC /* JitsiMeetBaseLogHandler+Private.h */; };
52
-		DE66914428BCC1C7007C4533 /* JitsiMeetSDK-Swift.h in Headers */ = {isa = PBXBuildFile; fileRef = DE66914328BCC1C7007C4533 /* JitsiMeetSDK-Swift.h */; };
53
-		DE66914528BCC1C7007C4533 /* JitsiMeetSDK-Swift.h in Headers */ = {isa = PBXBuildFile; fileRef = DE66914328BCC1C7007C4533 /* JitsiMeetSDK-Swift.h */; };
54 59
 		DE762DB422AFDE76000DEBD6 /* JitsiMeetUserInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = DE762DB322AFDE76000DEBD6 /* JitsiMeetUserInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
55 60
 		DE762DB622AFDE8D000DEBD6 /* JitsiMeetUserInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = DE762DB522AFDE8D000DEBD6 /* JitsiMeetUserInfo.m */; };
56 61
 		DE81A2D42316AC4D00AE1940 /* JitsiMeetLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = DE81A2D22316AC4D00AE1940 /* JitsiMeetLogger.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -93,15 +98,12 @@
93 98
 		DE9A0151289A9A9A00E41CBB /* LocaleDetector.m in Sources */ = {isa = PBXBuildFile; fileRef = DEFC743D21B178FA00E4DD96 /* LocaleDetector.m */; };
94 99
 		DE9A0152289A9A9A00E41CBB /* AudioMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BCA495C1EC4B6C600B793EE /* AudioMode.m */; };
95 100
 		DE9A0153289A9A9A00E41CBB /* Proximity.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BCA495E1EC4B6C600B793EE /* Proximity.m */; };
96
-		DE9A0154289A9A9A00E41CBB /* JMCallKitEmitter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C69EFA09209A0F650027712B /* JMCallKitEmitter.swift */; };
97 101
 		DE9A0155289A9A9A00E41CBB /* ReactUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = DEFE535521FB2E8300011A3A /* ReactUtils.m */; };
98 102
 		DE9A0156289A9A9A00E41CBB /* JitsiMeetView+Private.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EEC962F286C73A2008705FA /* JitsiMeetView+Private.m */; };
99 103
 		DE9A0157289A9A9A00E41CBB /* DragGestureController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6A3425E204EF76800E062DD /* DragGestureController.swift */; };
100 104
 		DE9A0158289A9A9A00E41CBB /* ScheenshareEventEmiter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E51B76325E5345E0038575A /* ScheenshareEventEmiter.m */; };
101 105
 		DE9A015A289A9A9A00E41CBB /* JitsiMeetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EBA6E60286072E300B31882 /* JitsiMeetViewController.m */; };
102
-		DE9A015B289A9A9A00E41CBB /* JMCallKitProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C69EFA0A209A0F660027712B /* JMCallKitProxy.swift */; };
103 106
 		DE9A015C289A9A9A00E41CBB /* JitsiMeetLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = DE81A2D32316AC4D00AE1940 /* JitsiMeetLogger.m */; };
104
-		DE9A015D289A9A9A00E41CBB /* JMCallKitListener.swift in Sources */ = {isa = PBXBuildFile; fileRef = C69EFA0B209A0F660027712B /* JMCallKitListener.swift */; };
105 107
 		DE9A015E289A9A9A00E41CBB /* JitsiMeetView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B412F171EDEC65D00B1A0A6 /* JitsiMeetView.m */; };
106 108
 		DE9A015F289A9A9A00E41CBB /* JitsiMeet.m in Sources */ = {isa = PBXBuildFile; fileRef = DEFE535321FB1BF800011A3A /* JitsiMeet.m */; };
107 109
 		DE9A0160289A9A9A00E41CBB /* JavaScriptSandbox.m in Sources */ = {isa = PBXBuildFile; fileRef = DE438CD82350934700DD541D /* JavaScriptSandbox.m */; };
@@ -139,6 +141,11 @@
139 141
 		0BD906E51EC0C00300C8C18E /* JitsiMeetSDK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JitsiMeetSDK.framework; sourceTree = BUILT_PRODUCTS_DIR; };
140 142
 		0BD906E81EC0C00300C8C18E /* JitsiMeet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JitsiMeet.h; sourceTree = "<group>"; };
141 143
 		0BD906E91EC0C00300C8C18E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
144
+		4E0EF62E28CA2FB3005D1B03 /* JMCallKitEmitter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JMCallKitEmitter.h; sourceTree = "<group>"; };
145
+		4E0EF62F28CA2FB3005D1B03 /* JMCallKitEmitter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JMCallKitEmitter.m; sourceTree = "<group>"; };
146
+		4E0EF63428CA317E005D1B03 /* JMCallKitListener.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JMCallKitListener.h; sourceTree = "<group>"; };
147
+		4E0EF63728CA4069005D1B03 /* JMCallKitProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JMCallKitProxy.h; sourceTree = "<group>"; };
148
+		4E0EF63828CA4069005D1B03 /* JMCallKitProxy.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JMCallKitProxy.m; sourceTree = "<group>"; };
142 149
 		4E51B76225E5345E0038575A /* ScheenshareEventEmiter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScheenshareEventEmiter.h; sourceTree = "<group>"; };
143 150
 		4E51B76325E5345E0038575A /* ScheenshareEventEmiter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ScheenshareEventEmiter.m; sourceTree = "<group>"; };
144 151
 		4EBA6E5F286072E300B31882 /* JitsiMeetViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JitsiMeetViewController.h; sourceTree = "<group>"; };
@@ -161,9 +168,6 @@
161 168
 		B46497DE9A95BDF5E312AF48 /* libPods-JitsiMeetSDKLite.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-JitsiMeetSDKLite.a"; sourceTree = BUILT_PRODUCTS_DIR; };
162 169
 		C6245F5B2053091D0040BE68 /* image-resize@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "image-resize@2x.png"; path = "src/picture-in-picture/image-resize@2x.png"; sourceTree = "<group>"; };
163 170
 		C6245F5C2053091D0040BE68 /* image-resize@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "image-resize@3x.png"; path = "src/picture-in-picture/image-resize@3x.png"; sourceTree = "<group>"; };
164
-		C69EFA09209A0F650027712B /* JMCallKitEmitter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JMCallKitEmitter.swift; sourceTree = "<group>"; };
165
-		C69EFA0A209A0F660027712B /* JMCallKitProxy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JMCallKitProxy.swift; sourceTree = "<group>"; };
166
-		C69EFA0B209A0F660027712B /* JMCallKitListener.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JMCallKitListener.swift; sourceTree = "<group>"; };
167 171
 		C6A3425E204EF76800E062DD /* DragGestureController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DragGestureController.swift; sourceTree = "<group>"; };
168 172
 		C6CC49AE207412CF000DFA42 /* PiPViewCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PiPViewCoordinator.swift; sourceTree = "<group>"; };
169 173
 		C81E9AB825AC5AD800B134D9 /* ExternalAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ExternalAPI.h; sourceTree = "<group>"; };
@@ -172,7 +176,6 @@
172 176
 		DE438CD82350934700DD541D /* JavaScriptSandbox.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JavaScriptSandbox.m; sourceTree = "<group>"; };
173 177
 		DE65AAC92317FFCD00290BEC /* LogUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LogUtils.h; sourceTree = "<group>"; };
174 178
 		DE65AACB2318028300290BEC /* JitsiMeetBaseLogHandler+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "JitsiMeetBaseLogHandler+Private.h"; sourceTree = "<group>"; };
175
-		DE66914328BCC1C7007C4533 /* JitsiMeetSDK-Swift.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "JitsiMeetSDK-Swift.h"; sourceTree = "<group>"; };
176 179
 		DE762DB322AFDE76000DEBD6 /* JitsiMeetUserInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JitsiMeetUserInfo.h; sourceTree = "<group>"; };
177 180
 		DE762DB522AFDE8D000DEBD6 /* JitsiMeetUserInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JitsiMeetUserInfo.m; sourceTree = "<group>"; };
178 181
 		DE762DB722AFE166000DEBD6 /* JitsiMeetUserInfo+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "JitsiMeetUserInfo+Private.h"; sourceTree = "<group>"; };
@@ -203,7 +206,7 @@
203 206
 			files = (
204 207
 				0BB9AD791F5EC6D7001C08DB /* Intents.framework in Frameworks */,
205 208
 				0BB9AD771F5EC6CE001C08DB /* CallKit.framework in Frameworks */,
206
-				6F08DF7D4458EE3CF3F36F6D /* BuildFile in Frameworks */,
209
+				6F08DF7D4458EE3CF3F36F6D /* (null) in Frameworks */,
207 210
 				3453F4A32680898C4A40E821 /* libPods-JitsiMeetSDK.a in Frameworks */,
208 211
 			);
209 212
 			runOnlyForDeploymentPostprocessing = 0;
@@ -306,7 +309,6 @@
306 309
 				4E51B76225E5345E0038575A /* ScheenshareEventEmiter.h */,
307 310
 				4E51B76325E5345E0038575A /* ScheenshareEventEmiter.m */,
308 311
 				DE9A0170289A9A9A00E41CBB /* Lite-Info.plist */,
309
-				DE66914328BCC1C7007C4533 /* JitsiMeetSDK-Swift.h */,
310 312
 			);
311 313
 			path = src;
312 314
 			sourceTree = "<group>";
@@ -349,9 +351,11 @@
349 351
 			isa = PBXGroup;
350 352
 			children = (
351 353
 				0BB9AD7A1F5EC8F4001C08DB /* CallKit.m */,
352
-				C69EFA09209A0F650027712B /* JMCallKitEmitter.swift */,
353
-				C69EFA0B209A0F660027712B /* JMCallKitListener.swift */,
354
-				C69EFA0A209A0F660027712B /* JMCallKitProxy.swift */,
354
+				4E0EF62E28CA2FB3005D1B03 /* JMCallKitEmitter.h */,
355
+				4E0EF62F28CA2FB3005D1B03 /* JMCallKitEmitter.m */,
356
+				4E0EF63428CA317E005D1B03 /* JMCallKitListener.h */,
357
+				4E0EF63728CA4069005D1B03 /* JMCallKitProxy.h */,
358
+				4E0EF63828CA4069005D1B03 /* JMCallKitProxy.m */,
355 359
 			);
356 360
 			path = callkit;
357 361
 			sourceTree = "<group>";
@@ -379,10 +383,12 @@
379 383
 				DEA9F284258A5D9900D4CD74 /* JitsiMeetSDK.h in Headers */,
380 384
 				4E51B76425E5345E0038575A /* ScheenshareEventEmiter.h in Headers */,
381 385
 				DE65AACC2318028300290BEC /* JitsiMeetBaseLogHandler+Private.h in Headers */,
382
-				DE66914428BCC1C7007C4533 /* JitsiMeetSDK-Swift.h in Headers */,
383 386
 				4EBA6E652860B1E800B31882 /* JitsiMeetRenderingView.h in Headers */,
384 387
 				0B412F221EDEF6EA00B1A0A6 /* JitsiMeetViewDelegate.h in Headers */,
388
+				4E0EF63528CA317E005D1B03 /* JMCallKitListener.h in Headers */,
389
+				4E0EF63028CA2FB3005D1B03 /* JMCallKitEmitter.h in Headers */,
385 390
 				4ED4FFF32721B9B90074E620 /* JitsiAudioSession.h in Headers */,
391
+				4E0EF63928CA4069005D1B03 /* JMCallKitProxy.h in Headers */,
386 392
 				4EEC9630286C73A2008705FA /* JitsiMeetView+Private.h in Headers */,
387 393
 				0BD906EA1EC0C00300C8C18E /* JitsiMeet.h in Headers */,
388 394
 				DE81A2D42316AC4D00AE1940 /* JitsiMeetLogger.h in Headers */,
@@ -405,10 +411,12 @@
405 411
 				DE9A0134289A9A9A00E41CBB /* JitsiMeetSDK.h in Headers */,
406 412
 				DE9A0135289A9A9A00E41CBB /* ScheenshareEventEmiter.h in Headers */,
407 413
 				DE9A0136289A9A9A00E41CBB /* JitsiMeetBaseLogHandler+Private.h in Headers */,
408
-				DE66914528BCC1C7007C4533 /* JitsiMeetSDK-Swift.h in Headers */,
409 414
 				DE9A0137289A9A9A00E41CBB /* JitsiMeetRenderingView.h in Headers */,
410 415
 				DE9A0138289A9A9A00E41CBB /* JitsiMeetViewDelegate.h in Headers */,
416
+				4E0EF63628CA317E005D1B03 /* JMCallKitListener.h in Headers */,
417
+				4E0EF63128CA2FB3005D1B03 /* JMCallKitEmitter.h in Headers */,
411 418
 				DE9A0139289A9A9A00E41CBB /* JitsiAudioSession.h in Headers */,
419
+				4E0EF63A28CA4069005D1B03 /* JMCallKitProxy.h in Headers */,
412 420
 				DE9A013A289A9A9A00E41CBB /* JitsiMeetView+Private.h in Headers */,
413 421
 				DE9A013B289A9A9A00E41CBB /* JitsiMeet.h in Headers */,
414 422
 				DE9A013C289A9A9A00E41CBB /* JitsiMeetLogger.h in Headers */,
@@ -677,6 +685,7 @@
677 685
 			files = (
678 686
 				0BB9AD7B1F5EC8F4001C08DB /* CallKit.m in Sources */,
679 687
 				DE81A2DF2317ED5400AE1940 /* JitsiMeetBaseLogHandler.m in Sources */,
688
+				4E0EF63B28CA4069005D1B03 /* JMCallKitProxy.m in Sources */,
680 689
 				4EBA6E662860B1E800B31882 /* JitsiMeetRenderingView.m in Sources */,
681 690
 				4ED4FFF42721B9B90074E620 /* JitsiAudioSession.m in Sources */,
682 691
 				0BB9AD7D1F60356D001C08DB /* AppInfo.m in Sources */,
@@ -692,16 +701,14 @@
692 701
 				DEFC743F21B178FA00E4DD96 /* LocaleDetector.m in Sources */,
693 702
 				0BCA495F1EC4B6C600B793EE /* AudioMode.m in Sources */,
694 703
 				0BCA49611EC4B6C600B793EE /* Proximity.m in Sources */,
695
-				C69EFA0C209A0F660027712B /* JMCallKitEmitter.swift in Sources */,
704
+				4E0EF63228CA2FB3005D1B03 /* JMCallKitEmitter.m in Sources */,
696 705
 				DEFE535621FB2E8300011A3A /* ReactUtils.m in Sources */,
697 706
 				4EEC9631286C73A2008705FA /* JitsiMeetView+Private.m in Sources */,
698 707
 				C6A34261204EF76800E062DD /* DragGestureController.swift in Sources */,
699 708
 				4E51B76525E5345E0038575A /* ScheenshareEventEmiter.m in Sources */,
700 709
 				A4A934E9212F3ADB001E9388 /* Dropbox.m in Sources */,
701 710
 				4EBA6E62286072E300B31882 /* JitsiMeetViewController.m in Sources */,
702
-				C69EFA0D209A0F660027712B /* JMCallKitProxy.swift in Sources */,
703 711
 				DE81A2D52316AC4D00AE1940 /* JitsiMeetLogger.m in Sources */,
704
-				C69EFA0E209A0F660027712B /* JMCallKitListener.swift in Sources */,
705 712
 				0B412F191EDEC65D00B1A0A6 /* JitsiMeetView.m in Sources */,
706 713
 				DEFE535421FB1BF800011A3A /* JitsiMeet.m in Sources */,
707 714
 				DE438CDA2350934700DD541D /* JavaScriptSandbox.m in Sources */,
@@ -716,6 +723,7 @@
716 723
 				DE9A0144289A9A9A00E41CBB /* JitsiMeetBaseLogHandler.m in Sources */,
717 724
 				DE9A0145289A9A9A00E41CBB /* JitsiMeetRenderingView.m in Sources */,
718 725
 				DE9A0146289A9A9A00E41CBB /* JitsiAudioSession.m in Sources */,
726
+				4E0EF63C28CA4069005D1B03 /* JMCallKitProxy.m in Sources */,
719 727
 				DE9A0147289A9A9A00E41CBB /* AppInfo.m in Sources */,
720 728
 				DE9A0148289A9A9A00E41CBB /* LogBridge.m in Sources */,
721 729
 				DE9A0149289A9A9A00E41CBB /* RNRootView.m in Sources */,
@@ -729,15 +737,13 @@
729 737
 				DE9A0151289A9A9A00E41CBB /* LocaleDetector.m in Sources */,
730 738
 				DE9A0152289A9A9A00E41CBB /* AudioMode.m in Sources */,
731 739
 				DE9A0153289A9A9A00E41CBB /* Proximity.m in Sources */,
732
-				DE9A0154289A9A9A00E41CBB /* JMCallKitEmitter.swift in Sources */,
733 740
 				DE9A0155289A9A9A00E41CBB /* ReactUtils.m in Sources */,
734 741
 				DE9A0156289A9A9A00E41CBB /* JitsiMeetView+Private.m in Sources */,
735 742
 				DE9A0157289A9A9A00E41CBB /* DragGestureController.swift in Sources */,
736 743
 				DE9A0158289A9A9A00E41CBB /* ScheenshareEventEmiter.m in Sources */,
737 744
 				DE9A015A289A9A9A00E41CBB /* JitsiMeetViewController.m in Sources */,
738
-				DE9A015B289A9A9A00E41CBB /* JMCallKitProxy.swift in Sources */,
739 745
 				DE9A015C289A9A9A00E41CBB /* JitsiMeetLogger.m in Sources */,
740
-				DE9A015D289A9A9A00E41CBB /* JMCallKitListener.swift in Sources */,
746
+				4E0EF63328CA2FB3005D1B03 /* JMCallKitEmitter.m in Sources */,
741 747
 				DE9A015E289A9A9A00E41CBB /* JitsiMeetView.m in Sources */,
742 748
 				DE9A015F289A9A9A00E41CBB /* JitsiMeet.m in Sources */,
743 749
 				DE9A0160289A9A9A00E41CBB /* JavaScriptSandbox.m in Sources */,

+ 0
- 271
ios/sdk/src/JitsiMeetSDK-Swift.h Näytä tiedosto

@@ -1,271 +0,0 @@
1
-// IMPORTANT!
2
-// This file was once auto-generated by Xcode, and this is a copy of it. If any of the following
3
-// classes is modified this file needs to be regenerated.
4
-//   - JMCallKitListener
5
-//   - JMCallKitProxy
6
-#ifndef JITSIMEETSDK_SWIFT_H
7
-#define JITSIMEETSDK_SWIFT_H
8
-#pragma clang diagnostic push
9
-#pragma clang diagnostic ignored "-Wgcc-compat"
10
-
11
-#if !defined(__has_include)
12
-# define __has_include(x) 0
13
-#endif
14
-#if !defined(__has_attribute)
15
-# define __has_attribute(x) 0
16
-#endif
17
-#if !defined(__has_feature)
18
-# define __has_feature(x) 0
19
-#endif
20
-#if !defined(__has_warning)
21
-# define __has_warning(x) 0
22
-#endif
23
-
24
-#if __has_include(<swift/objc-prologue.h>)
25
-# include <swift/objc-prologue.h>
26
-#endif
27
-
28
-#pragma clang diagnostic ignored "-Wauto-import"
29
-#include <Foundation/Foundation.h>
30
-#include <stdint.h>
31
-#include <stddef.h>
32
-#include <stdbool.h>
33
-
34
-#if !defined(SWIFT_TYPEDEFS)
35
-# define SWIFT_TYPEDEFS 1
36
-# if __has_include(<uchar.h>)
37
-#  include <uchar.h>
38
-# elif !defined(__cplusplus)
39
-typedef uint_least16_t char16_t;
40
-typedef uint_least32_t char32_t;
41
-# endif
42
-typedef float swift_float2  __attribute__((__ext_vector_type__(2)));
43
-typedef float swift_float3  __attribute__((__ext_vector_type__(3)));
44
-typedef float swift_float4  __attribute__((__ext_vector_type__(4)));
45
-typedef double swift_double2  __attribute__((__ext_vector_type__(2)));
46
-typedef double swift_double3  __attribute__((__ext_vector_type__(3)));
47
-typedef double swift_double4  __attribute__((__ext_vector_type__(4)));
48
-typedef int swift_int2  __attribute__((__ext_vector_type__(2)));
49
-typedef int swift_int3  __attribute__((__ext_vector_type__(3)));
50
-typedef int swift_int4  __attribute__((__ext_vector_type__(4)));
51
-typedef unsigned int swift_uint2  __attribute__((__ext_vector_type__(2)));
52
-typedef unsigned int swift_uint3  __attribute__((__ext_vector_type__(3)));
53
-typedef unsigned int swift_uint4  __attribute__((__ext_vector_type__(4)));
54
-#endif
55
-
56
-#if !defined(SWIFT_PASTE)
57
-# define SWIFT_PASTE_HELPER(x, y) x##y
58
-# define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y)
59
-#endif
60
-#if !defined(SWIFT_METATYPE)
61
-# define SWIFT_METATYPE(X) Class
62
-#endif
63
-#if !defined(SWIFT_CLASS_PROPERTY)
64
-# if __has_feature(objc_class_property)
65
-#  define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__
66
-# else
67
-#  define SWIFT_CLASS_PROPERTY(...)
68
-# endif
69
-#endif
70
-
71
-#if __has_attribute(objc_runtime_name)
72
-# define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X)))
73
-#else
74
-# define SWIFT_RUNTIME_NAME(X)
75
-#endif
76
-#if __has_attribute(swift_name)
77
-# define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X)))
78
-#else
79
-# define SWIFT_COMPILE_NAME(X)
80
-#endif
81
-#if __has_attribute(objc_method_family)
82
-# define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X)))
83
-#else
84
-# define SWIFT_METHOD_FAMILY(X)
85
-#endif
86
-#if __has_attribute(noescape)
87
-# define SWIFT_NOESCAPE __attribute__((noescape))
88
-#else
89
-# define SWIFT_NOESCAPE
90
-#endif
91
-#if __has_attribute(ns_consumed)
92
-# define SWIFT_RELEASES_ARGUMENT __attribute__((ns_consumed))
93
-#else
94
-# define SWIFT_RELEASES_ARGUMENT
95
-#endif
96
-#if __has_attribute(warn_unused_result)
97
-# define SWIFT_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
98
-#else
99
-# define SWIFT_WARN_UNUSED_RESULT
100
-#endif
101
-#if __has_attribute(noreturn)
102
-# define SWIFT_NORETURN __attribute__((noreturn))
103
-#else
104
-# define SWIFT_NORETURN
105
-#endif
106
-#if !defined(SWIFT_CLASS_EXTRA)
107
-# define SWIFT_CLASS_EXTRA
108
-#endif
109
-#if !defined(SWIFT_PROTOCOL_EXTRA)
110
-# define SWIFT_PROTOCOL_EXTRA
111
-#endif
112
-#if !defined(SWIFT_ENUM_EXTRA)
113
-# define SWIFT_ENUM_EXTRA
114
-#endif
115
-#if !defined(SWIFT_CLASS)
116
-# if __has_attribute(objc_subclassing_restricted)
117
-#  define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA
118
-#  define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
119
-# else
120
-#  define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
121
-#  define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA
122
-# endif
123
-#endif
124
-#if !defined(SWIFT_RESILIENT_CLASS)
125
-# if __has_attribute(objc_class_stub)
126
-#  define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME) __attribute__((objc_class_stub))
127
-#  define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_class_stub)) SWIFT_CLASS_NAMED(SWIFT_NAME)
128
-# else
129
-#  define SWIFT_RESILIENT_CLASS(SWIFT_NAME) SWIFT_CLASS(SWIFT_NAME)
130
-#  define SWIFT_RESILIENT_CLASS_NAMED(SWIFT_NAME) SWIFT_CLASS_NAMED(SWIFT_NAME)
131
-# endif
132
-#endif
133
-
134
-#if !defined(SWIFT_PROTOCOL)
135
-# define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
136
-# define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA
137
-#endif
138
-
139
-#if !defined(SWIFT_EXTENSION)
140
-# define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__)
141
-#endif
142
-
143
-#if !defined(OBJC_DESIGNATED_INITIALIZER)
144
-# if __has_attribute(objc_designated_initializer)
145
-#  define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer))
146
-# else
147
-#  define OBJC_DESIGNATED_INITIALIZER
148
-# endif
149
-#endif
150
-#if !defined(SWIFT_ENUM_ATTR)
151
-# if defined(__has_attribute) && __has_attribute(enum_extensibility)
152
-#  define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
153
-# else
154
-#  define SWIFT_ENUM_ATTR(_extensibility)
155
-# endif
156
-#endif
157
-#if !defined(SWIFT_ENUM)
158
-# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
159
-# if __has_feature(generalized_swift_name)
160
-#  define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
161
-# else
162
-#  define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
163
-# endif
164
-#endif
165
-#if !defined(SWIFT_UNAVAILABLE)
166
-# define SWIFT_UNAVAILABLE __attribute__((unavailable))
167
-#endif
168
-#if !defined(SWIFT_UNAVAILABLE_MSG)
169
-# define SWIFT_UNAVAILABLE_MSG(msg) __attribute__((unavailable(msg)))
170
-#endif
171
-#if !defined(SWIFT_AVAILABILITY)
172
-# define SWIFT_AVAILABILITY(plat, ...) __attribute__((availability(plat, __VA_ARGS__)))
173
-#endif
174
-#if !defined(SWIFT_WEAK_IMPORT)
175
-# define SWIFT_WEAK_IMPORT __attribute__((weak_import))
176
-#endif
177
-#if !defined(SWIFT_DEPRECATED)
178
-# define SWIFT_DEPRECATED __attribute__((deprecated))
179
-#endif
180
-#if !defined(SWIFT_DEPRECATED_MSG)
181
-# define SWIFT_DEPRECATED_MSG(...) __attribute__((deprecated(__VA_ARGS__)))
182
-#endif
183
-#if __has_feature(attribute_diagnose_if_objc)
184
-# define SWIFT_DEPRECATED_OBJC(Msg) __attribute__((diagnose_if(1, Msg, "warning")))
185
-#else
186
-# define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
187
-#endif
188
-#if !defined(IBSegueAction)
189
-# define IBSegueAction
190
-#endif
191
-#if !defined(SWIFT_EXTERN)
192
-# if defined(__cplusplus)
193
-#  define SWIFT_EXTERN extern "C"
194
-# else
195
-#  define SWIFT_EXTERN extern
196
-# endif
197
-#endif
198
-#if __has_feature(modules)
199
-#if __has_warning("-Watimport-in-framework-header")
200
-#pragma clang diagnostic ignored "-Watimport-in-framework-header"
201
-#endif
202
-@import CallKit;
203
-@import ObjectiveC;
204
-#endif
205
-
206
-#pragma clang diagnostic ignored "-Wproperty-attribute-mismatch"
207
-#pragma clang diagnostic ignored "-Wduplicate-method-arg"
208
-#if __has_warning("-Wpragma-clang-attribute")
209
-# pragma clang diagnostic ignored "-Wpragma-clang-attribute"
210
-#endif
211
-#pragma clang diagnostic ignored "-Wunknown-pragmas"
212
-#pragma clang diagnostic ignored "-Wnullability"
213
-
214
-#if __has_attribute(external_source_symbol)
215
-# pragma push_macro("any")
216
-# undef any
217
-# pragma clang attribute push(__attribute__((external_source_symbol(language="Swift", defined_in="JitsiMeetSDK",generated_declaration))), apply_to=any(function,enum,objc_interface,objc_category,objc_protocol))
218
-# pragma pop_macro("any")
219
-#endif
220
-
221
-
222
-
223
-@class NSUUID;
224
-@class AVAudioSession;
225
-@class CXAction;
226
-
227
-SWIFT_PROTOCOL("_TtP12JitsiMeetSDK17JMCallKitListener_")
228
-@protocol JMCallKitListener <NSObject>
229
-@optional
230
-- (void)providerDidReset;
231
-- (void)performAnswerCallWithUUID:(NSUUID * _Nonnull)UUID;
232
-- (void)performEndCallWithUUID:(NSUUID * _Nonnull)UUID;
233
-- (void)performSetMutedCallWithUUID:(NSUUID * _Nonnull)UUID isMuted:(BOOL)isMuted;
234
-- (void)performStartCallWithUUID:(NSUUID * _Nonnull)UUID isVideo:(BOOL)isVideo;
235
-- (void)providerDidActivateAudioSessionWithSession:(AVAudioSession * _Nonnull)session;
236
-- (void)providerDidDeactivateAudioSessionWithSession:(AVAudioSession * _Nonnull)session;
237
-- (void)providerTimedOutPerformingActionWithAction:(CXAction * _Nonnull)action;
238
-@end
239
-
240
-@class NSString;
241
-@class NSData;
242
-@class NSDate;
243
-@class CXTransaction;
244
-
245
-SWIFT_CLASS("_TtC12JitsiMeetSDK14JMCallKitProxy")
246
-@interface JMCallKitProxy : NSObject
247
-- (nonnull instancetype)init SWIFT_UNAVAILABLE;
248
-+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
249
-/// Enables the proxy in between CallKit and the consumers of the SDK.
250
-/// Defaults to disabled. Set to true when you want to use CallKit.
251
-SWIFT_CLASS_PROPERTY(@property (nonatomic, class) BOOL enabled;)
252
-+ (BOOL)enabled SWIFT_WARN_UNUSED_RESULT;
253
-+ (void)setEnabled:(BOOL)value;
254
-+ (void)configureProviderWithLocalizedName:(NSString * _Nonnull)localizedName ringtoneSound:(NSString * _Nullable)ringtoneSound iconTemplateImageData:(NSData * _Nullable)iconTemplateImageData;
255
-+ (BOOL)isProviderConfigured SWIFT_WARN_UNUSED_RESULT;
256
-+ (void)addListener:(id <JMCallKitListener> _Nonnull)listener;
257
-+ (void)removeListener:(id <JMCallKitListener> _Nonnull)listener;
258
-+ (BOOL)hasActiveCallForUUID:(NSString * _Nonnull)callUUID SWIFT_WARN_UNUSED_RESULT;
259
-+ (void)reportNewIncomingCallWithUUID:(NSUUID * _Nonnull)UUID handle:(NSString * _Nullable)handle displayName:(NSString * _Nullable)displayName hasVideo:(BOOL)hasVideo completion:(void (^ _Nonnull)(NSError * _Nullable))completion;
260
-+ (void)reportCallUpdateWith:(NSUUID * _Nonnull)UUID handle:(NSString * _Nullable)handle displayName:(NSString * _Nullable)displayName hasVideo:(BOOL)hasVideo;
261
-+ (void)reportCallWith:(NSUUID * _Nonnull)UUID endedAt:(NSDate * _Nullable)dateEnded reason:(CXCallEndedReason)endedReason;
262
-+ (void)reportOutgoingCallWith:(NSUUID * _Nonnull)UUID startedConnectingAt:(NSDate * _Nullable)dateStartedConnecting;
263
-+ (void)reportOutgoingCallWith:(NSUUID * _Nonnull)UUID connectedAt:(NSDate * _Nullable)dateConnected;
264
-+ (void)request:(CXTransaction * _Nonnull)transaction completion:(void (^ _Nonnull)(NSError * _Nullable))completion;
265
-@end
266
-
267
-#if __has_attribute(external_source_symbol)
268
-# pragma clang attribute pop
269
-#endif
270
-#pragma clang diagnostic pop
271
-#endif

+ 2
- 0
ios/sdk/src/JitsiMeetSDK.h Näytä tiedosto

@@ -22,3 +22,5 @@
22 22
 #import <JitsiMeetSDK/JitsiMeetBaseLogHandler.h>
23 23
 #import <JitsiMeetSDK/JitsiAudioSession.h>
24 24
 #import <JitsiMeetSDK/InfoPlistUtil.h>
25
+#import <JitsiMeetSDK/JMCallKitListener.h>
26
+#import <JitsiMeetSDK/JMCallKitProxy.h>

+ 1
- 1
ios/sdk/src/callkit/CallKit.m Näytä tiedosto

@@ -30,7 +30,7 @@
30 30
 #import <WebRTC/WebRTC.h>
31 31
 
32 32
 #import "../JitsiAudioSession.h"
33
-#import "../JitsiMeetSDK-Swift.h"
33
+#import "JMCallKitProxy.h"
34 34
 
35 35
 
36 36
 // The events emitted/supported by RNCallKit:

+ 35
- 0
ios/sdk/src/callkit/JMCallKitEmitter.h Näytä tiedosto

@@ -0,0 +1,35 @@
1
+/*
2
+ * Copyright @ 2022-present 8x8, Inc.
3
+ * Copyright @ 2018-present Atlassian Pty Ltd
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ *     http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+#import <CallKit/CallKit.h>
19
+#import <Foundation/Foundation.h>
20
+#import "JMCallKitListener.h"
21
+
22
+NS_ASSUME_NONNULL_BEGIN
23
+
24
+@interface JMCallKitEmitter : NSObject <CXProviderDelegate>
25
+
26
+#pragma mark Add/Remove listeners
27
+- (void)addListener:(id<JMCallKitListener>)listener;
28
+- (void)removeListener:(id<JMCallKitListener>)listener;
29
+
30
+#pragma mark Add mute action
31
+- (void)addMuteAction:(NSUUID *)actionUUID;
32
+
33
+@end
34
+
35
+NS_ASSUME_NONNULL_END

+ 116
- 0
ios/sdk/src/callkit/JMCallKitEmitter.m Näytä tiedosto

@@ -0,0 +1,116 @@
1
+/*
2
+ * Copyright @ 2022-present 8x8, Inc.
3
+ * Copyright @ 2018-present Atlassian Pty Ltd
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ *     http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+#import "JMCallKitEmitter.h"
19
+
20
+@interface JMCallKitEmitter()
21
+
22
+@property(nonatomic, strong) NSMutableArray<id<JMCallKitListener>> *listeners;
23
+@property(nonatomic, strong) NSMutableSet<NSUUID *> *pendingMuteActions;
24
+
25
+@end
26
+
27
+@implementation JMCallKitEmitter
28
+
29
+- (instancetype)init {
30
+    self = [super init];
31
+    if (self) {
32
+        self.listeners = [[NSMutableArray alloc] init];
33
+        self.pendingMuteActions = [[NSMutableSet alloc] init];
34
+    }
35
+    return self;
36
+}
37
+
38
+#pragma mark Add/Remove listeners
39
+
40
+- (void)addListener:(id<JMCallKitListener>)listener {
41
+    if (![self.listeners containsObject:listener]) {
42
+        [self.listeners addObject:listener];
43
+    }
44
+}
45
+
46
+- (void)removeListener:(id<JMCallKitListener>)listener {
47
+    [self.listeners removeObject:listener];
48
+}
49
+
50
+#pragma mark Add mute action
51
+
52
+- (void)addMuteAction:(NSUUID *)actionUUID {
53
+    [self.pendingMuteActions addObject:actionUUID];
54
+}
55
+
56
+#pragma mark CXProviderDelegate
57
+
58
+- (void)providerDidReset:(CXProvider *)provider {
59
+    for (id listener in self.listeners) {
60
+        [listener providerDidReset];
61
+    }
62
+    [self.pendingMuteActions removeAllObjects];
63
+}
64
+
65
+- (void)provider:(CXProvider *)provider performAnswerCallAction:(CXAnswerCallAction *)action {
66
+    for (id listener in self.listeners) {
67
+        [listener performAnswerCallWithUUID:action.callUUID];
68
+    }
69
+    [action fulfill];
70
+}
71
+
72
+- (void)provider:(CXProvider *)provider performEndCallAction:(CXEndCallAction *)action {
73
+    for (id listener in self.listeners) {
74
+        [listener performEndCallWithUUID:action.callUUID];
75
+    }
76
+    [action fulfill];
77
+}
78
+
79
+- (void)provider:(CXProvider *)provider performSetMutedCallAction:(CXSetMutedCallAction *)action {
80
+    NSUUID *uuid = ([self.pendingMuteActions containsObject:action.UUID]) ? action.UUID : nil;
81
+    [self.pendingMuteActions removeObject:action.UUID];
82
+    
83
+    // Avoid mute actions ping-pong: if the mute action was caused by
84
+    // the JS side (we requested a transaction) don't call the delegate
85
+    // method. If it was called by the provider itself (when the user presses
86
+    // the mute button in the CallKit view) then call the delegate method.
87
+    //
88
+    // NOTE: don't try to be clever and remove this. Been there, done that.
89
+    // Won't work.
90
+    if (uuid == nil) {
91
+        for (id listener in self.listeners) {
92
+            [listener performSetMutedCallWithUUID:action.callUUID isMuted:action.isMuted];
93
+        }
94
+    }
95
+    [action fulfill];
96
+}
97
+
98
+- (void)provider:(CXProvider *)provider performStartCallAction:(CXStartCallAction *)action {
99
+    for (id listener in self.listeners) {
100
+        [listener performStartCallWithUUID:action.callUUID isVideo:action.isVideo];
101
+    }
102
+}
103
+
104
+- (void)provider:(CXProvider *)provider didActivateAudioSession:(AVAudioSession *)audioSession {
105
+    for (id listener in self.listeners) {
106
+        [listener providerDidActivateAudioSessionWithSession:audioSession];
107
+    }
108
+}
109
+
110
+- (void)provider:(CXProvider *)provider didDeactivateAudioSession:(AVAudioSession *)audioSession {
111
+    for (id listener in self.listeners) {
112
+        [listener providerDidDeactivateAudioSessionWithSession:audioSession];
113
+    }
114
+}
115
+
116
+@end

+ 0
- 118
ios/sdk/src/callkit/JMCallKitEmitter.swift Näytä tiedosto

@@ -1,118 +0,0 @@
1
-/*
2
- * Copyright @ 2018-present Atlassian Pty Ltd
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- *     http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-import AVKit
18
-import CallKit
19
-import Foundation
20
-
21
-internal final class JMCallKitEmitter: NSObject, CXProviderDelegate {
22
-
23
-    private let listeners = NSMutableArray()
24
-    private var pendingMuteActions = Set<UUID>()
25
-
26
-    internal override init() {}
27
-
28
-    // MARK: - Add/remove listeners
29
-
30
-    func addListener(_ listener: JMCallKitListener) {
31
-        if (!listeners.contains(listener)) {
32
-            listeners.add(listener)
33
-        }
34
-    }
35
-
36
-    func removeListener(_ listener: JMCallKitListener) {
37
-        listeners.remove(listener)
38
-    }
39
-
40
-    // MARK: - Add mute action
41
-
42
-    func addMuteAction(_ actionUUID: UUID) {
43
-        pendingMuteActions.insert(actionUUID)
44
-    }
45
-
46
-    // MARK: - CXProviderDelegate
47
-
48
-    func providerDidReset(_ provider: CXProvider) {
49
-        listeners.forEach {
50
-            let listener = $0 as! JMCallKitListener
51
-            listener.providerDidReset?()
52
-        }
53
-        pendingMuteActions.removeAll()
54
-    }
55
-
56
-    func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) {
57
-        listeners.forEach {
58
-            let listener = $0 as! JMCallKitListener
59
-            listener.performAnswerCall?(UUID: action.callUUID)
60
-        }
61
-
62
-        action.fulfill()
63
-    }
64
-
65
-    func provider(_ provider: CXProvider, perform action: CXEndCallAction) {
66
-        listeners.forEach {
67
-            let listener = $0 as! JMCallKitListener
68
-            listener.performEndCall?(UUID: action.callUUID)
69
-        }
70
-
71
-        action.fulfill()
72
-    }
73
-
74
-    func provider(_ provider: CXProvider, perform action: CXSetMutedCallAction) {
75
-        let uuid = pendingMuteActions.remove(action.uuid)
76
-
77
-        // Avoid mute actions ping-pong: if the mute action was caused by
78
-        // the JS side (we requested a transaction) don't call the delegate
79
-        // method. If it was called by the provider itself (when the user presses
80
-        // the mute button in the CallKit view) then call the delegate method.
81
-        //
82
-        // NOTE: don't try to be clever and remove this. Been there, done that.
83
-        // Won't work.
84
-        if (uuid == nil) {
85
-            listeners.forEach {
86
-                let listener = $0 as! JMCallKitListener
87
-                listener.performSetMutedCall?(UUID: action.callUUID, isMuted: action.isMuted)
88
-            }
89
-        }
90
-
91
-        action.fulfill()
92
-    }
93
-
94
-    func provider(_ provider: CXProvider, perform action: CXStartCallAction) {
95
-        listeners.forEach {
96
-            let listener = $0 as! JMCallKitListener
97
-            listener.performStartCall?(UUID: action.callUUID, isVideo: action.isVideo)
98
-        }
99
-
100
-        action.fulfill()
101
-    }
102
-
103
-    func provider(_ provider: CXProvider,
104
-                  didActivate audioSession: AVAudioSession) {
105
-        listeners.forEach {
106
-            let listener = $0 as! JMCallKitListener
107
-            listener.providerDidActivateAudioSession?(session: audioSession)
108
-        }
109
-    }
110
-
111
-    func provider(_ provider: CXProvider,
112
-                  didDeactivate audioSession: AVAudioSession) {
113
-        listeners.forEach {
114
-            let listener = $0 as! JMCallKitListener
115
-            listener.providerDidDeactivateAudioSession?(session: audioSession)
116
-        }
117
-    }
118
-}

+ 34
- 0
ios/sdk/src/callkit/JMCallKitListener.h Näytä tiedosto

@@ -0,0 +1,34 @@
1
+/*
2
+ * Copyright @ 2022-present 8x8, Inc.
3
+ * Copyright @ 2018-present Atlassian Pty Ltd
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ *     http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+#import <AVKit/AVKit.h>
19
+#import <CallKit/CallKit.h>
20
+#import <Foundation/Foundation.h>
21
+
22
+@protocol JMCallKitListener <NSObject>
23
+
24
+@optional
25
+- (void)providerDidReset;
26
+- (void)performAnswerCallWithUUID:(nonnull NSUUID *)UUID;
27
+- (void)performEndCallWithUUID:(nonnull NSUUID *)UUID;
28
+- (void)performSetMutedCallWithUUID:(nonnull NSUUID *)UUID isMuted:(BOOL)isMuted;
29
+- (void)performStartCallWithUUID:(nonnull NSUUID *)UUID isVideo:(BOOL)isVideo;
30
+- (void)providerDidActivateAudioSessionWithSession:(nonnull AVAudioSession *)session;
31
+- (void)providerDidDeactivateAudioSessionWithSession:(nonnull AVAudioSession *)session;
32
+- (void)providerTimedOutPerformingActionWithAction:(nonnull CXAction *)action;
33
+
34
+@end

+ 0
- 38
ios/sdk/src/callkit/JMCallKitListener.swift Näytä tiedosto

@@ -1,38 +0,0 @@
1
-/*
2
- * Copyright @ 2018-present Atlassian Pty Ltd
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- *     http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-import AVKit
18
-import CallKit
19
-import Foundation
20
-
21
-@objc public protocol JMCallKitListener: NSObjectProtocol {
22
-
23
-    @objc optional func providerDidReset()
24
-
25
-    @objc optional func performAnswerCall(UUID: UUID)
26
-
27
-    @objc optional func performEndCall(UUID: UUID)
28
-
29
-    @objc optional func performSetMutedCall(UUID: UUID, isMuted: Bool)
30
-
31
-    @objc optional func performStartCall(UUID: UUID, isVideo: Bool)
32
-
33
-    @objc optional func providerDidActivateAudioSession(session: AVAudioSession)
34
-
35
-    @objc optional func providerDidDeactivateAudioSession(session: AVAudioSession)
36
-
37
-    @objc optional func providerTimedOutPerformingAction(action: CXAction)
38
-}

+ 87
- 0
ios/sdk/src/callkit/JMCallKitProxy.h Näytä tiedosto

@@ -0,0 +1,87 @@
1
+/*
2
+ * Copyright @ 2022-present 8x8, Inc.
3
+ * Copyright @ 2018-present Atlassian Pty Ltd
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ *     http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+#import <CallKit/CallKit.h>
19
+#import <Foundation/Foundation.h>
20
+#import "JMCallKitListener.h"
21
+
22
+NS_ASSUME_NONNULL_BEGIN
23
+
24
+@protocol CXProviderProtocol <NSObject>
25
+
26
+@property (nonatomic, readwrite, copy) CXProviderConfiguration* configuration;
27
+
28
+- (void)setDelegate:(nullable id<CXProviderDelegate>)delegate queue:(nullable dispatch_queue_t)queue;
29
+- (void)reportNewIncomingCallWithUUID:(NSUUID *)uuid update:(CXCallUpdate *)update completion:(void (^)(NSError *))completion;
30
+- (void)reportCallWithUUID:(NSUUID *)uuid updated:(CXCallUpdate *)update;
31
+- (void)reportCallWithUUID:(NSUUID *)uuid endedAtDate:(NSDate *)dateEnded reason:(CXCallEndedReason)endedReason;
32
+- (void)reportOutgoingCallWithUUID:(NSUUID *)uuid startedConnectingAtDate:(NSDate *)dateStartedConnecting;
33
+- (void)reportOutgoingCallWithUUID:(NSUUID *)uuid connectedAtDate:(NSDate *)dateConnected;
34
+- (void)invalidate;
35
+
36
+@end
37
+
38
+#pragma mark -
39
+@protocol CXCallControllerProtocol <NSObject>
40
+
41
+@property (nonatomic, readonly) NSArray<CXCall*> *calls;
42
+
43
+- (void)requestTransaction:(CXTransaction *)transaction completion:(void (^)(NSError *_Nullable))completion;
44
+
45
+@end
46
+
47
+#pragma mark -
48
+
49
+/// JitsiMeet CallKit proxy
50
+// NOTE: The methods this class exposes are meant to be called in the UI thread.
51
+// All delegate methods called by JMCallKitEmitter will be called in the UI thread.
52
+@interface JMCallKitProxy : NSObject
53
+
54
+/// Enables the proxy in between CallKit and the consumers of the SDK.
55
+/// Defaults to disabled. Set to true when you want to use CallKit.
56
+@property (class) BOOL enabled;
57
+@property (class) id<CXProviderProtocol> callKitProvider;
58
+@property (class) id<CXCallControllerProtocol> callKitCallController;
59
+
60
++ (void)configureProviderWithLocalizedName:(nonnull NSString *)localizedName
61
+                             ringtoneSound:(nullable NSString *)ringtoneSound
62
+                    iconTemplateImageData:(nullable NSData*)imageData
63
+NS_SWIFT_NAME(configureProvider(localizedName:ringtoneSound:iconTemplateImageData:));
64
++ (BOOL)isProviderConfigured;
65
++ (void)addListener:(nonnull id<JMCallKitListener>)listener NS_SWIFT_NAME(addListener(_:));
66
++ (void)removeListener:(nonnull id<JMCallKitListener>)listener NS_SWIFT_NAME(removeListener(_:));
67
++ (BOOL)hasActiveCallForUUID:(nonnull NSString *)callUUID NS_SWIFT_NAME(hasActiveCallForUUID(_:));
68
++ (void)reportNewIncomingCallWithUUID:(nonnull NSUUID *)uuid
69
+                               handle:(nullable NSString*)handle
70
+                          displayName:(nullable NSString*)displayName
71
+                             hasVideo:(BOOL)hasVideo
72
+                           completion:(nonnull void (^)(NSError *_Nullable))completion
73
+NS_SWIFT_NAME(reportNewIncomingCall(UUID:handle:displayName:hasVideo:completion:));
74
++ (void)reportCallUpdateWith:(nonnull NSUUID *)uuid
75
+                      handle:(nullable NSString *)handle
76
+                 displayName:(nullable NSString *)displayName
77
+                    hasVideo:(BOOL)hasVideo;
78
++ (void)reportCallWith:(nonnull NSUUID *)uuid
79
+               endedAt:(nullable NSDate *)dateEnded
80
+                reason:(CXCallEndedReason)endedReason;
81
++ (void)reportOutgoingCallWith:(nonnull NSUUID *)uuid startedConnectingAt:(nullable NSDate *)dateStartedConnecting;
82
++ (void)reportOutgoingCallWith:(nonnull NSUUID *)uuid connectedAt:(nullable NSDate *)dateConnected;
83
++ (void)request:(nonnull CXTransaction *)transaction completion:(nonnull void (^)(NSError *_Nullable))completion;
84
+
85
+@end
86
+
87
+NS_ASSUME_NONNULL_END

+ 284
- 0
ios/sdk/src/callkit/JMCallKitProxy.m Näytä tiedosto

@@ -0,0 +1,284 @@
1
+/*
2
+ * Copyright @ 2022-present 8x8, Inc.
3
+ * Copyright @ 2018-present Atlassian Pty Ltd
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ *     http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+#import "JMCallKitProxy.h"
19
+#import "JMCallKitEmitter.h"
20
+
21
+#pragma mark -
22
+@interface CXProvider(CXProviderProtocol) <CXProviderProtocol>
23
+@end
24
+
25
+@implementation CXProvider(CXProviderProtocol)
26
+@end
27
+
28
+#pragma mark -
29
+@interface CXCallController(CXCallControllerProtocol) <CXCallControllerProtocol>
30
+
31
+@property (nonatomic, readonly) NSArray<CXCall*> *calls;
32
+
33
+@end
34
+
35
+@implementation CXCallController(CXCallControllerProtocol)
36
+
37
+@dynamic calls;
38
+
39
+- (NSArray<CXCall*> *)calls {
40
+    return self.callObserver.calls;
41
+}
42
+
43
+@end
44
+
45
+#pragma mark -
46
+@interface JMCallKitProxy ()
47
+    
48
+@property (class) CXProvider *defaultProvider;
49
+@property (class) CXProviderConfiguration *providerConfiguration;
50
+
51
+@end
52
+
53
+@interface JMCallKitProxy (Helpers)
54
+
55
++ (CXCallUpdate *)makeCXUpdateWithHandle:(nullable NSString *)handle displayName:(nullable NSString *)displayName hasVideo:(BOOL)hasVideo;
56
+
57
+@end
58
+
59
+@implementation JMCallKitProxy
60
+
61
+@dynamic callKitProvider, callKitCallController, enabled;
62
+@dynamic defaultProvider, providerConfiguration;
63
+
64
+static id<CXProviderProtocol> _callKitProvider = nil;
65
+static id<CXCallControllerProtocol> _callKitCallController = nil;
66
+static BOOL _enabled = false;
67
+static CXProvider *_defaultProvider = nil;
68
+static CXProviderConfiguration *_providerConfiguration = nil;
69
+
70
+#pragma mark CallJit proxy
71
+
72
++ (id<CXProviderProtocol>)callKitProvider {
73
+    return _callKitProvider;
74
+}
75
+
76
++ (void)setCallKitProvider:(id<CXProviderProtocol>)callKitProvider {
77
+    if (_callKitProvider != callKitProvider) {
78
+        _callKitProvider = callKitProvider;
79
+    }
80
+}
81
+
82
++ (id<CXCallControllerProtocol>)callKitCallController {
83
+    return  _callKitCallController;
84
+}
85
+
86
++ (void)setCallKitCallController:(id<CXCallControllerProtocol>)callKitCallController {
87
+    if (_callKitCallController != callKitCallController) {
88
+        _callKitCallController = callKitCallController;
89
+    }
90
+}
91
+
92
++ (BOOL)enabled {
93
+    return _enabled;
94
+}
95
+
96
++ (void)setEnabled:(BOOL)enabled {
97
+    _enabled = enabled ;
98
+    
99
+    if (!self.callKitProvider) {
100
+        [self.provider invalidate];
101
+    }
102
+    
103
+    if (enabled) {
104
+        CXProviderConfiguration *configuration = self.providerConfiguration? self.providerConfiguration : [[CXProviderConfiguration alloc] initWithLocalizedName:@""];
105
+        if (!self.callKitProvider) {
106
+            self.defaultProvider = [[CXProvider alloc] initWithConfiguration: configuration];
107
+        }
108
+        
109
+        [self.provider setDelegate:self.emitter queue:nil];
110
+    } else {
111
+        [self.provider setDelegate:nil queue:nil];
112
+    }
113
+}
114
+
115
++ (CXProvider *)defaultProvider {
116
+    return _defaultProvider;
117
+}
118
+
119
++ (void)setDefaultProvider:(CXProvider *)defaultProvider {
120
+    if (_defaultProvider != defaultProvider) {
121
+        _defaultProvider = defaultProvider;
122
+    }
123
+}
124
+
125
++ (id<CXProviderProtocol>)provider {
126
+    return self.callKitProvider != nil ? self.callKitProvider : self.defaultProvider;
127
+}
128
+
129
++ (id<CXCallControllerProtocol>)callController {
130
+    return self.callKitCallController != nil ? self.callKitCallController : self.defaultCallController;
131
+}
132
+
133
++ (CXProviderConfiguration *)providerConfiguration {
134
+    return _providerConfiguration;
135
+}
136
+
137
++ (void)setProviderConfiguration:(CXProviderConfiguration *)providerConfiguration {
138
+    if (_providerConfiguration != providerConfiguration) {
139
+        _providerConfiguration = providerConfiguration;
140
+        
141
+        if (providerConfiguration) {
142
+            self.provider.configuration = providerConfiguration;
143
+            [self.provider setDelegate:self.emitter queue:nil];
144
+        }
145
+    }
146
+}
147
+
148
++ (CXCallController *)defaultCallController {
149
+    static dispatch_once_t once;
150
+    static CXCallController *defaultCallController;
151
+    dispatch_once(&once, ^{
152
+        defaultCallController = [[CXCallController alloc] init];
153
+    });
154
+    
155
+    return defaultCallController;
156
+}
157
+
158
++ (JMCallKitEmitter *)emitter {
159
+    static dispatch_once_t once;
160
+    static JMCallKitEmitter *emitter;
161
+    dispatch_once(&once, ^{
162
+        emitter = [[JMCallKitEmitter alloc] init];
163
+    });
164
+    
165
+    return emitter;
166
+}
167
+
168
++ (void)configureProviderWithLocalizedName:(nonnull NSString *)localizedName
169
+                             ringtoneSound:(nullable NSString *)ringtoneSound
170
+                    iconTemplateImageData:(nullable NSData*)imageData {
171
+    if (!self.enabled) {
172
+        return;
173
+    }
174
+    
175
+    CXProviderConfiguration *configuration = [[CXProviderConfiguration alloc] initWithLocalizedName:localizedName];
176
+    configuration.iconTemplateImageData = imageData;
177
+    configuration.maximumCallGroups = 1;
178
+    configuration.maximumCallsPerCallGroup = 1;
179
+    configuration.ringtoneSound = ringtoneSound;
180
+    configuration.supportedHandleTypes = [NSSet setWithArray:@[@(CXHandleTypeGeneric)]];
181
+    configuration.supportsVideo = true;
182
+    
183
+    self.providerConfiguration = configuration;
184
+}
185
+
186
++ (BOOL)isProviderConfigured {
187
+    return self.providerConfiguration != nil;
188
+}
189
+
190
++ (void)addListener:(nonnull id<JMCallKitListener>)listener {
191
+    [self.emitter addListener:listener];
192
+}
193
+
194
++ (void)removeListener:(nonnull id<JMCallKitListener>)listener {
195
+    [self.emitter removeListener:listener];
196
+}
197
+
198
++ (BOOL)hasActiveCallForUUID:(nonnull NSString *)callUUID {
199
+    CXCall *activeCallForUUID = [[self.callController calls] filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(CXCall *evaluatedObject, NSDictionary<NSString *,id> *bindings) {
200
+        return evaluatedObject.UUID.UUIDString == callUUID;
201
+    }]].firstObject;
202
+    
203
+    if (!activeCallForUUID) {
204
+        return false;
205
+    }
206
+    return true;
207
+}
208
+
209
++ (void)reportNewIncomingCallWithUUID:(nonnull NSUUID *)uuid
210
+                               handle:(nullable NSString*)handle
211
+                          displayName:(nullable NSString*)displayName
212
+                             hasVideo:(BOOL)hasVideo
213
+                           completion:(nonnull void (^)(NSError *_Nullable))completion {
214
+    if (!self.enabled) {
215
+        return;
216
+    }
217
+    
218
+    CXCallUpdate *callUpdate = [self makeCXUpdateWithHandle:handle displayName:displayName hasVideo:hasVideo];
219
+    [self.provider reportNewIncomingCallWithUUID:uuid update:callUpdate completion:completion];
220
+}
221
+
222
++ (void)reportCallUpdateWith:(nonnull NSUUID *)uuid
223
+                      handle:(nullable NSString *)handle
224
+                 displayName:(nullable NSString *)displayName
225
+                    hasVideo:(BOOL)hasVideo {
226
+    if (!self.enabled) {
227
+        return;
228
+    }
229
+    
230
+    CXCallUpdate *callUpdate = [self makeCXUpdateWithHandle:handle displayName:displayName hasVideo:hasVideo];
231
+    [self.provider reportCallWithUUID:uuid updated:callUpdate];
232
+}
233
+
234
++ (void)reportCallWith:(nonnull NSUUID *)uuid
235
+               endedAt:(nullable NSDate *)dateEnded
236
+                reason:(CXCallEndedReason)endedReason {
237
+    [self.provider reportCallWithUUID:uuid endedAtDate:dateEnded reason:endedReason];
238
+}
239
+
240
++ (void)reportOutgoingCallWith:(nonnull NSUUID *)uuid startedConnectingAt:(nullable NSDate *)dateStartedConnecting {
241
+    [self.provider reportOutgoingCallWithUUID:uuid startedConnectingAtDate:dateStartedConnecting];
242
+}
243
+
244
++ (void)reportOutgoingCallWith:(nonnull NSUUID *)uuid connectedAt:(nullable NSDate *)dateConnected {
245
+    [self.provider reportOutgoingCallWithUUID:uuid connectedAtDate:dateConnected];
246
+}
247
+
248
++ (void)request:(nonnull CXTransaction *)transaction completion:(nonnull void (^)(NSError *_Nullable))completion {
249
+    if (!self.enabled) {
250
+        return;
251
+    }
252
+    
253
+    // XXX keep track of muted actions to avoid "ping-pong"ing. See
254
+    // JMCallKitEmitter for details on the CXSetMutedCallAction handling.
255
+    for (CXAction *action in transaction.actions) {
256
+        if ([CXAction isKindOfClass:[CXSetMutedCallAction class]]) {
257
+            [self.emitter addMuteAction:action.UUID];
258
+        }
259
+    }
260
+    
261
+    [self.callController requestTransaction:transaction completion:completion];
262
+}
263
+
264
+@end
265
+
266
+@implementation JMCallKitProxy (Helpers)
267
+
268
++ (CXCallUpdate *)makeCXUpdateWithHandle:(nullable NSString *)handle displayName:(nullable NSString *)displayName hasVideo:(BOOL)hasVideo {
269
+    CXCallUpdate *update = [[CXCallUpdate alloc] init];
270
+    update.supportsDTMF = false;
271
+    update.supportsHolding = false;
272
+    update.supportsGrouping = false;
273
+    update.supportsUngrouping = false;
274
+    update.hasVideo = hasVideo;
275
+    update.localizedCallerName = displayName;
276
+    
277
+    if (handle) {
278
+        update.remoteHandle = [[CXHandle alloc] initWithType:CXHandleTypeGeneric value:handle];
279
+    }
280
+    
281
+    return update;
282
+}
283
+
284
+@end

+ 0
- 231
ios/sdk/src/callkit/JMCallKitProxy.swift Näytä tiedosto

@@ -1,231 +0,0 @@
1
-/*
2
- * Copyright @ 2018-present 8x8, Inc.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- *     http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-import CallKit
18
-import Foundation
19
-
20
-public protocol CXProviderProtocol: AnyObject {
21
-    var configuration: CXProviderConfiguration { get set }
22
-    func setDelegate(_ delegate: CXProviderDelegate?, queue: DispatchQueue?)
23
-    func reportNewIncomingCall(with UUID: UUID, update: CXCallUpdate, completion: @escaping (Error?) -> Void)
24
-    func reportCall(with UUID: UUID, updated update: CXCallUpdate)
25
-    func reportCall(with UUID: UUID, endedAt dateEnded: Date?, reason endedReason: CXCallEndedReason)
26
-    func reportOutgoingCall(with UUID: UUID, startedConnectingAt dateStartedConnecting: Date?)
27
-    func reportOutgoingCall(with UUID: UUID, connectedAt dateConnected: Date?)
28
-    func invalidate()
29
-}
30
-
31
-public protocol CXCallControllerProtocol: AnyObject {
32
-    var calls: [CXCall] { get }
33
-    func request(_ transaction: CXTransaction, completion: @escaping (Error?) -> Swift.Void)
34
-}
35
-
36
-extension CXProvider: CXProviderProtocol {}
37
-extension CXCallController: CXCallControllerProtocol {
38
-    public var calls: [CXCall] {
39
-        return callObserver.calls
40
-    }
41
-}
42
-
43
-/// JitsiMeet CallKit proxy
44
-// NOTE: The methods this class exposes are meant to be called in the UI thread.
45
-// All delegate methods called by JMCallKitEmitter will be called in the UI thread.
46
-@objc public final class JMCallKitProxy: NSObject {
47
-
48
-    private override init() {}
49
-
50
-    // MARK: - CallKit proxy
51
-    
52
-    public static var callKitProvider: CXProviderProtocol?
53
-    public static var callKitCallController: CXCallControllerProtocol?
54
-
55
-    private static var defaultProvider: CXProvider?
56
-
57
-    private static var provider: CXProviderProtocol? {
58
-        callKitProvider ?? defaultProvider
59
-    }
60
-    
61
-    private static var callController: CXCallControllerProtocol {
62
-        callKitCallController ?? defaultCallController
63
-    }
64
-
65
-    private static var providerConfiguration: CXProviderConfiguration? {
66
-        didSet {
67
-            guard let configuration = providerConfiguration else { return }
68
-            provider?.configuration = configuration
69
-            provider?.setDelegate(emitter, queue: nil)
70
-        }
71
-    }
72
-    
73
-    private static let defaultCallController: CXCallController = {
74
-        return CXCallController()
75
-    }()
76
-    
77
-    private static let emitter: JMCallKitEmitter = {
78
-        return JMCallKitEmitter()
79
-    }()
80
-
81
-    /// Enables the proxy in between CallKit and the consumers of the SDK.
82
-    /// Defaults to disabled. Set to true when you want to use CallKit.
83
-    @objc public static var enabled: Bool = false {
84
-        didSet {
85
-            if callKitProvider == nil {
86
-                provider?.invalidate()
87
-            }
88
-            
89
-            if enabled {
90
-                let configuration = providerConfiguration ?? CXProviderConfiguration(localizedName: "")
91
-                if callKitProvider == nil {
92
-                    defaultProvider = CXProvider(configuration: configuration)
93
-                }
94
-                
95
-                provider?.setDelegate(emitter, queue: nil)
96
-            } else {
97
-                provider?.setDelegate(nil, queue: nil)
98
-            }
99
-        }
100
-    }
101
-
102
-    @objc public static func configureProvider(localizedName: String,
103
-                                               ringtoneSound: String?,
104
-                                               iconTemplateImageData: Data?) {
105
-        guard enabled else { return }
106
-
107
-        let configuration = CXProviderConfiguration(localizedName: localizedName)
108
-        configuration.iconTemplateImageData = iconTemplateImageData
109
-        configuration.maximumCallGroups = 1
110
-        configuration.maximumCallsPerCallGroup = 1
111
-        configuration.ringtoneSound = ringtoneSound
112
-        configuration.supportedHandleTypes = [CXHandle.HandleType.generic]
113
-        configuration.supportsVideo = true
114
-
115
-        providerConfiguration = configuration
116
-    }
117
-
118
-    @objc public static func isProviderConfigured() -> Bool {
119
-        return providerConfiguration != nil
120
-    }
121
-
122
-    @objc public static func addListener(_ listener: JMCallKitListener) {
123
-        emitter.addListener(listener)
124
-    }
125
-
126
-    @objc public static func removeListener(_ listener: JMCallKitListener) {
127
-        emitter.removeListener(listener)
128
-    }
129
-
130
-    @objc public static func hasActiveCallForUUID(_ callUUID: String) -> Bool {
131
-        let activeCallForUUID = callController.calls.first {
132
-            $0.uuid == UUID(uuidString: callUUID)
133
-        }
134
-        guard activeCallForUUID != nil else { return false }
135
-        return true
136
-    }
137
-
138
-    @objc public static func reportNewIncomingCall(UUID: UUID,
139
-                                                   handle: String?,
140
-                                                   displayName: String?,
141
-                                                   hasVideo: Bool,
142
-                                                   completion: @escaping (Error?) -> Void) {
143
-        guard enabled else { return }
144
-
145
-        let callUpdate = makeCXUpdate(handle: handle,
146
-                                      displayName: displayName,
147
-                                      hasVideo: hasVideo)
148
-        provider?.reportNewIncomingCall(with: UUID,
149
-                                        update: callUpdate,
150
-                                        completion: completion)
151
-    }
152
-
153
-    @objc public static func reportCallUpdate(with UUID: UUID,
154
-                                              handle: String?,
155
-                                              displayName: String?,
156
-                                              hasVideo: Bool) {
157
-        guard enabled else { return }
158
-
159
-        let callUpdate = makeCXUpdate(handle: handle,
160
-                                      displayName: displayName,
161
-                                      hasVideo: hasVideo)
162
-        provider?.reportCall(with: UUID, updated: callUpdate)
163
-    }
164
-
165
-    @objc public static func reportCall(
166
-            with UUID: UUID,
167
-            endedAt dateEnded: Date?,
168
-            reason endedReason: CXCallEndedReason) {
169
-        guard enabled else { return }
170
-        provider?.reportCall(with: UUID,
171
-                             endedAt: dateEnded,
172
-                             reason: endedReason)
173
-    }
174
-
175
-    @objc public static func reportOutgoingCall(
176
-            with UUID: UUID,
177
-            startedConnectingAt dateStartedConnecting: Date?) {
178
-        guard enabled else { return }
179
-        provider?.reportOutgoingCall(with: UUID,
180
-                                     startedConnectingAt: dateStartedConnecting)
181
-    }
182
-
183
-    @objc public static func reportOutgoingCall(
184
-            with UUID: UUID,
185
-            connectedAt dateConnected: Date?) {
186
-        guard enabled else { return }
187
-
188
-        provider?.reportOutgoingCall(with: UUID, connectedAt: dateConnected)
189
-    }
190
-
191
-    @objc public static func request(
192
-            _ transaction: CXTransaction,
193
-            completion: @escaping (Error?) -> Swift.Void) {
194
-        guard enabled else { return }
195
-
196
-        // XXX keep track of muted actions to avoid "ping-pong"ing. See
197
-        // JMCallKitEmitter for details on the CXSetMutedCallAction handling.
198
-        for action in transaction.actions {
199
-            if (action as? CXSetMutedCallAction) != nil {
200
-                emitter.addMuteAction(action.uuid)
201
-            }
202
-        }
203
-
204
-        callController.request(transaction, completion: completion)
205
-    }
206
-
207
-    // MARK: - Callkit Proxy helpers
208
-
209
-    private static func makeCXUpdate(handle: String?,
210
-                                     displayName: String?,
211
-                                     hasVideo: Bool) -> CXCallUpdate {
212
-        let update = CXCallUpdate()
213
-        update.supportsDTMF = false
214
-        update.supportsHolding = false
215
-        update.supportsGrouping = false
216
-        update.supportsUngrouping = false
217
-        update.hasVideo = hasVideo
218
-
219
-        if let handle = handle {
220
-            update.remoteHandle = CXHandle(type: .generic,
221
-                                           value: handle)
222
-        }
223
-
224
-        if let displayName = displayName {
225
-            update.localizedCallerName = displayName
226
-        }
227
-
228
-        return update
229
-    }
230
-}
231
-

Loading…
Peruuta
Tallenna