Browse Source

[RN] Add initial Jitsi Meet SDK for iOS

Ladies and gentlemen, allow me to introduce you to Jitsi Meet SDK for iOS, the
mobile SDK which powers Jitsi Meet.

The goal is to encapsulate the entire React Native app into a framework / SDK
and offer an API for native (ObjC or Swift) applications to embed the Jitsi
conferencing experience.

While React Native can be embedded in native applications, I don't think it was
designed to be embedded as part of a framework, hidden away from the application
using it. This surfaced as a number of issues which had to be addressed
specifically due to our use-case:

- Universal / deep linking needed to be wrapped to avoid the embedding app from
  linking with RN.
- The bundle URL had to be manually constructed, since RN considers that all
  resources are in the main bundle, but in case of a framework that is not the
  case.
- Custom fonts had to be manually loaded, since UIAppFonts doesn't work on the
  framework's Info.plist file.
- The RN packager has to be manually triggered since the React project will no
  longer do it for us.
- Custom App Transport Security rules were added since the builtin way to do it
  modifies the framework's Info.plist, which is useless in this case.

At this stage, the Jitsi Meet application is just a small single view
application which uses the Jitsi Meet SDK to create a single view which
represents the entire application. Events and external conference handling are
forthcoming.
master
Saúl Ibarra Corretgé 8 years ago
parent
commit
b1100a9c7a

+ 4
- 0
.gitignore View File

@@ -65,3 +65,7 @@ buck-out/
65 65
 fastlane/report.xml
66 66
 fastlane/Preview.html
67 67
 fastlane/screenshots
68
+
69
+# CocoaPods
70
+Pods/
71
+Podfile.lock

+ 445
- 0
ios/Jitsi Meet SDK.xcodeproj/project.pbxproj View File

@@ -0,0 +1,445 @@
1
+// !$*UTF8*$!
2
+{
3
+	archiveVersion = 1;
4
+	classes = {
5
+	};
6
+	objectVersion = 46;
7
+	objects = {
8
+
9
+/* Begin PBXBuildFile section */
10
+		0B412F181EDEC65D00B1A0A6 /* JitsiMeetView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B412F161EDEC65D00B1A0A6 /* JitsiMeetView.h */; settings = {ATTRIBUTES = (Public, ); }; };
11
+		0B412F191EDEC65D00B1A0A6 /* JitsiMeetView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B412F171EDEC65D00B1A0A6 /* JitsiMeetView.m */; };
12
+		0B412F221EDEF6EA00B1A0A6 /* JitsiMeetViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B412F1B1EDEC80100B1A0A6 /* JitsiMeetViewDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
13
+		0B93EF7B1EC608550030D24D /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0B93EF7A1EC608550030D24D /* CoreText.framework */; };
14
+		0B93EF7E1EC9DDCD0030D24D /* JitsiRCTBridgeWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B93EF7C1EC9DDCD0030D24D /* JitsiRCTBridgeWrapper.h */; };
15
+		0B93EF7F1EC9DDCD0030D24D /* JitsiRTCBridgeWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B93EF7D1EC9DDCD0030D24D /* JitsiRTCBridgeWrapper.m */; };
16
+		0BCA495F1EC4B6C600B793EE /* AudioMode.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BCA495C1EC4B6C600B793EE /* AudioMode.m */; };
17
+		0BCA49601EC4B6C600B793EE /* POSIX.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BCA495D1EC4B6C600B793EE /* POSIX.m */; };
18
+		0BCA49611EC4B6C600B793EE /* Proximity.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BCA495E1EC4B6C600B793EE /* Proximity.m */; };
19
+		0BCA49641EC4B76D00B793EE /* WebRTC.framework in Copy embedded WebRTC framework */ = {isa = PBXBuildFile; fileRef = 0BCA49631EC4B76D00B793EE /* WebRTC.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
20
+		0BCA496C1EC4BBF900B793EE /* jitsi.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0BCA496B1EC4BBF900B793EE /* jitsi.ttf */; };
21
+		0BD906EA1EC0C00300C8C18E /* JitsiMeet.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BD906E81EC0C00300C8C18E /* JitsiMeet.h */; settings = {ATTRIBUTES = (Public, ); }; };
22
+		399E84404A63DA0F3B34EB9C /* libPods-JitsiMeet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F102AB2F4BCDCF220A512816 /* libPods-JitsiMeet.a */; };
23
+/* End PBXBuildFile section */
24
+
25
+/* Begin PBXCopyFilesBuildPhase section */
26
+		0BCA49621EC4B74500B793EE /* Copy embedded WebRTC framework */ = {
27
+			isa = PBXCopyFilesBuildPhase;
28
+			buildActionMask = 2147483647;
29
+			dstPath = "";
30
+			dstSubfolderSpec = 10;
31
+			files = (
32
+				0BCA49641EC4B76D00B793EE /* WebRTC.framework in Copy embedded WebRTC framework */,
33
+			);
34
+			name = "Copy embedded WebRTC framework";
35
+			runOnlyForDeploymentPostprocessing = 0;
36
+		};
37
+/* End PBXCopyFilesBuildPhase section */
38
+
39
+/* Begin PBXFileReference section */
40
+		062651321278D27A9BAEFAD4 /* Pods-JitsiMeet.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JitsiMeet.debug.xcconfig"; path = "Pods/Target Support Files/Pods-JitsiMeet/Pods-JitsiMeet.debug.xcconfig"; sourceTree = "<group>"; };
41
+		0B412F161EDEC65D00B1A0A6 /* JitsiMeetView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JitsiMeetView.h; sourceTree = "<group>"; };
42
+		0B412F171EDEC65D00B1A0A6 /* JitsiMeetView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JitsiMeetView.m; sourceTree = "<group>"; };
43
+		0B412F1B1EDEC80100B1A0A6 /* JitsiMeetViewDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JitsiMeetViewDelegate.h; sourceTree = "<group>"; };
44
+		0B93EF7A1EC608550030D24D /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; };
45
+		0B93EF7C1EC9DDCD0030D24D /* JitsiRCTBridgeWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JitsiRCTBridgeWrapper.h; sourceTree = "<group>"; };
46
+		0B93EF7D1EC9DDCD0030D24D /* JitsiRTCBridgeWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JitsiRTCBridgeWrapper.m; sourceTree = "<group>"; };
47
+		0BCA495C1EC4B6C600B793EE /* AudioMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioMode.m; sourceTree = "<group>"; };
48
+		0BCA495D1EC4B6C600B793EE /* POSIX.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = POSIX.m; sourceTree = "<group>"; };
49
+		0BCA495E1EC4B6C600B793EE /* Proximity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Proximity.m; sourceTree = "<group>"; };
50
+		0BCA49631EC4B76D00B793EE /* WebRTC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebRTC.framework; path = "../node_modules/react-native-webrtc/ios/WebRTC.framework"; sourceTree = "<group>"; };
51
+		0BCA496B1EC4BBF900B793EE /* jitsi.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = jitsi.ttf; path = ../fonts/jitsi.ttf; sourceTree = "<group>"; };
52
+		0BD906E51EC0C00300C8C18E /* JitsiMeet.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JitsiMeet.framework; sourceTree = BUILT_PRODUCTS_DIR; };
53
+		0BD906E81EC0C00300C8C18E /* JitsiMeet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JitsiMeet.h; sourceTree = "<group>"; };
54
+		0BD906E91EC0C00300C8C18E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
55
+		E358F7AEFCB4033712107DF5 /* Pods-JitsiMeet.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JitsiMeet.release.xcconfig"; path = "Pods/Target Support Files/Pods-JitsiMeet/Pods-JitsiMeet.release.xcconfig"; sourceTree = "<group>"; };
56
+		F102AB2F4BCDCF220A512816 /* libPods-JitsiMeet.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-JitsiMeet.a"; sourceTree = BUILT_PRODUCTS_DIR; };
57
+/* End PBXFileReference section */
58
+
59
+/* Begin PBXFrameworksBuildPhase section */
60
+		0BD906E11EC0C00300C8C18E /* Frameworks */ = {
61
+			isa = PBXFrameworksBuildPhase;
62
+			buildActionMask = 2147483647;
63
+			files = (
64
+				0B93EF7B1EC608550030D24D /* CoreText.framework in Frameworks */,
65
+				399E84404A63DA0F3B34EB9C /* libPods-JitsiMeet.a in Frameworks */,
66
+			);
67
+			runOnlyForDeploymentPostprocessing = 0;
68
+		};
69
+/* End PBXFrameworksBuildPhase section */
70
+
71
+/* Begin PBXGroup section */
72
+		0BCA49681EC4BBE500B793EE /* Resources */ = {
73
+			isa = PBXGroup;
74
+			children = (
75
+				0BCA496B1EC4BBF900B793EE /* jitsi.ttf */,
76
+			);
77
+			name = Resources;
78
+			sourceTree = "<group>";
79
+		};
80
+		0BD906DB1EC0C00300C8C18E = {
81
+			isa = PBXGroup;
82
+			children = (
83
+				0BCA49681EC4BBE500B793EE /* Resources */,
84
+				0BD906E71EC0C00300C8C18E /* sdk */,
85
+				0BD906E61EC0C00300C8C18E /* Products */,
86
+				C2471A7E156487CC2009E5E0 /* Pods */,
87
+				9C3C6FA2341729836589B856 /* Frameworks */,
88
+			);
89
+			sourceTree = "<group>";
90
+		};
91
+		0BD906E61EC0C00300C8C18E /* Products */ = {
92
+			isa = PBXGroup;
93
+			children = (
94
+				0BD906E51EC0C00300C8C18E /* JitsiMeet.framework */,
95
+			);
96
+			name = Products;
97
+			sourceTree = "<group>";
98
+		};
99
+		0BD906E71EC0C00300C8C18E /* sdk */ = {
100
+			isa = PBXGroup;
101
+			children = (
102
+				0BD906E81EC0C00300C8C18E /* JitsiMeet.h */,
103
+				0BCA495C1EC4B6C600B793EE /* AudioMode.m */,
104
+				0BCA495D1EC4B6C600B793EE /* POSIX.m */,
105
+				0BCA495E1EC4B6C600B793EE /* Proximity.m */,
106
+				0BD906E91EC0C00300C8C18E /* Info.plist */,
107
+				0B93EF7C1EC9DDCD0030D24D /* JitsiRCTBridgeWrapper.h */,
108
+				0B93EF7D1EC9DDCD0030D24D /* JitsiRTCBridgeWrapper.m */,
109
+				0B412F1B1EDEC80100B1A0A6 /* JitsiMeetViewDelegate.h */,
110
+				0B412F161EDEC65D00B1A0A6 /* JitsiMeetView.h */,
111
+				0B412F171EDEC65D00B1A0A6 /* JitsiMeetView.m */,
112
+			);
113
+			path = sdk;
114
+			sourceTree = "<group>";
115
+		};
116
+		9C3C6FA2341729836589B856 /* Frameworks */ = {
117
+			isa = PBXGroup;
118
+			children = (
119
+				0B93EF7A1EC608550030D24D /* CoreText.framework */,
120
+				0BCA49631EC4B76D00B793EE /* WebRTC.framework */,
121
+				F102AB2F4BCDCF220A512816 /* libPods-JitsiMeet.a */,
122
+			);
123
+			name = Frameworks;
124
+			sourceTree = "<group>";
125
+		};
126
+		C2471A7E156487CC2009E5E0 /* Pods */ = {
127
+			isa = PBXGroup;
128
+			children = (
129
+				062651321278D27A9BAEFAD4 /* Pods-JitsiMeet.debug.xcconfig */,
130
+				E358F7AEFCB4033712107DF5 /* Pods-JitsiMeet.release.xcconfig */,
131
+			);
132
+			name = Pods;
133
+			sourceTree = "<group>";
134
+		};
135
+/* End PBXGroup section */
136
+
137
+/* Begin PBXHeadersBuildPhase section */
138
+		0BD906E21EC0C00300C8C18E /* Headers */ = {
139
+			isa = PBXHeadersBuildPhase;
140
+			buildActionMask = 2147483647;
141
+			files = (
142
+				0B412F181EDEC65D00B1A0A6 /* JitsiMeetView.h in Headers */,
143
+				0B93EF7E1EC9DDCD0030D24D /* JitsiRCTBridgeWrapper.h in Headers */,
144
+				0B412F221EDEF6EA00B1A0A6 /* JitsiMeetViewDelegate.h in Headers */,
145
+				0BD906EA1EC0C00300C8C18E /* JitsiMeet.h in Headers */,
146
+			);
147
+			runOnlyForDeploymentPostprocessing = 0;
148
+		};
149
+/* End PBXHeadersBuildPhase section */
150
+
151
+/* Begin PBXNativeTarget section */
152
+		0BD906E41EC0C00300C8C18E /* JitsiMeet */ = {
153
+			isa = PBXNativeTarget;
154
+			buildConfigurationList = 0BD906ED1EC0C00300C8C18E /* Build configuration list for PBXNativeTarget "JitsiMeet" */;
155
+			buildPhases = (
156
+				8203CAE533C18CEC8284C979 /* [CP] Check Pods Manifest.lock */,
157
+				0BD906E01EC0C00300C8C18E /* Sources */,
158
+				0BD906E11EC0C00300C8C18E /* Frameworks */,
159
+				0BD906E21EC0C00300C8C18E /* Headers */,
160
+				0BD906E31EC0C00300C8C18E /* Resources */,
161
+				512A060342EDB080C9BBD5BA /* [CP] Copy Pods Resources */,
162
+				0BCA49621EC4B74500B793EE /* Copy embedded WebRTC framework */,
163
+				0BCA49651EC4B77500B793EE /* Package React bundle */,
164
+			);
165
+			buildRules = (
166
+			);
167
+			dependencies = (
168
+			);
169
+			name = JitsiMeet;
170
+			productName = "Jitsi Meet SDK";
171
+			productReference = 0BD906E51EC0C00300C8C18E /* JitsiMeet.framework */;
172
+			productType = "com.apple.product-type.framework";
173
+		};
174
+/* End PBXNativeTarget section */
175
+
176
+/* Begin PBXProject section */
177
+		0BD906DC1EC0C00300C8C18E /* Project object */ = {
178
+			isa = PBXProject;
179
+			attributes = {
180
+				LastUpgradeCheck = 0830;
181
+				ORGANIZATIONNAME = Jitsi;
182
+				TargetAttributes = {
183
+					0BD906E41EC0C00300C8C18E = {
184
+						CreatedOnToolsVersion = 8.3.2;
185
+						DevelopmentTeam = BQNXB4G3KQ;
186
+						ProvisioningStyle = Automatic;
187
+					};
188
+				};
189
+			};
190
+			buildConfigurationList = 0BD906DF1EC0C00300C8C18E /* Build configuration list for PBXProject "Jitsi Meet SDK" */;
191
+			compatibilityVersion = "Xcode 3.2";
192
+			developmentRegion = English;
193
+			hasScannedForEncodings = 0;
194
+			knownRegions = (
195
+				en,
196
+			);
197
+			mainGroup = 0BD906DB1EC0C00300C8C18E;
198
+			productRefGroup = 0BD906E61EC0C00300C8C18E /* Products */;
199
+			projectDirPath = "";
200
+			projectRoot = "";
201
+			targets = (
202
+				0BD906E41EC0C00300C8C18E /* JitsiMeet */,
203
+			);
204
+		};
205
+/* End PBXProject section */
206
+
207
+/* Begin PBXResourcesBuildPhase section */
208
+		0BD906E31EC0C00300C8C18E /* Resources */ = {
209
+			isa = PBXResourcesBuildPhase;
210
+			buildActionMask = 2147483647;
211
+			files = (
212
+				0BCA496C1EC4BBF900B793EE /* jitsi.ttf in Resources */,
213
+			);
214
+			runOnlyForDeploymentPostprocessing = 0;
215
+		};
216
+/* End PBXResourcesBuildPhase section */
217
+
218
+/* Begin PBXShellScriptBuildPhase section */
219
+		0BCA49651EC4B77500B793EE /* Package React bundle */ = {
220
+			isa = PBXShellScriptBuildPhase;
221
+			buildActionMask = 2147483647;
222
+			files = (
223
+			);
224
+			inputPaths = (
225
+			);
226
+			name = "Package React bundle";
227
+			outputPaths = (
228
+			);
229
+			runOnlyForDeploymentPostprocessing = 0;
230
+			shellPath = /bin/sh;
231
+			shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
232
+		};
233
+		512A060342EDB080C9BBD5BA /* [CP] Copy Pods Resources */ = {
234
+			isa = PBXShellScriptBuildPhase;
235
+			buildActionMask = 2147483647;
236
+			files = (
237
+			);
238
+			inputPaths = (
239
+			);
240
+			name = "[CP] Copy Pods Resources";
241
+			outputPaths = (
242
+			);
243
+			runOnlyForDeploymentPostprocessing = 0;
244
+			shellPath = /bin/sh;
245
+			shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-JitsiMeet/Pods-JitsiMeet-resources.sh\"\n";
246
+			showEnvVarsInLog = 0;
247
+		};
248
+		8203CAE533C18CEC8284C979 /* [CP] Check Pods Manifest.lock */ = {
249
+			isa = PBXShellScriptBuildPhase;
250
+			buildActionMask = 2147483647;
251
+			files = (
252
+			);
253
+			inputPaths = (
254
+			);
255
+			name = "[CP] Check Pods Manifest.lock";
256
+			outputPaths = (
257
+			);
258
+			runOnlyForDeploymentPostprocessing = 0;
259
+			shellPath = /bin/sh;
260
+			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n";
261
+			showEnvVarsInLog = 0;
262
+		};
263
+/* End PBXShellScriptBuildPhase section */
264
+
265
+/* Begin PBXSourcesBuildPhase section */
266
+		0BD906E01EC0C00300C8C18E /* Sources */ = {
267
+			isa = PBXSourcesBuildPhase;
268
+			buildActionMask = 2147483647;
269
+			files = (
270
+				0B93EF7F1EC9DDCD0030D24D /* JitsiRTCBridgeWrapper.m in Sources */,
271
+				0BCA49601EC4B6C600B793EE /* POSIX.m in Sources */,
272
+				0BCA495F1EC4B6C600B793EE /* AudioMode.m in Sources */,
273
+				0BCA49611EC4B6C600B793EE /* Proximity.m in Sources */,
274
+				0B412F191EDEC65D00B1A0A6 /* JitsiMeetView.m in Sources */,
275
+			);
276
+			runOnlyForDeploymentPostprocessing = 0;
277
+		};
278
+/* End PBXSourcesBuildPhase section */
279
+
280
+/* Begin XCBuildConfiguration section */
281
+		0BD906EB1EC0C00300C8C18E /* Debug */ = {
282
+			isa = XCBuildConfiguration;
283
+			buildSettings = {
284
+				ALWAYS_SEARCH_USER_PATHS = NO;
285
+				CLANG_ANALYZER_NONNULL = YES;
286
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
287
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
288
+				CLANG_CXX_LIBRARY = "libc++";
289
+				CLANG_ENABLE_MODULES = YES;
290
+				CLANG_ENABLE_OBJC_ARC = YES;
291
+				CLANG_WARN_BOOL_CONVERSION = YES;
292
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
293
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
294
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
295
+				CLANG_WARN_EMPTY_BODY = YES;
296
+				CLANG_WARN_ENUM_CONVERSION = YES;
297
+				CLANG_WARN_INFINITE_RECURSION = YES;
298
+				CLANG_WARN_INT_CONVERSION = YES;
299
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
300
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
301
+				CLANG_WARN_UNREACHABLE_CODE = YES;
302
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
303
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
304
+				COPY_PHASE_STRIP = NO;
305
+				CURRENT_PROJECT_VERSION = 1;
306
+				DEBUG_INFORMATION_FORMAT = dwarf;
307
+				ENABLE_BITCODE = NO;
308
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
309
+				ENABLE_TESTABILITY = YES;
310
+				GCC_C_LANGUAGE_STANDARD = gnu99;
311
+				GCC_DYNAMIC_NO_PIC = NO;
312
+				GCC_NO_COMMON_BLOCKS = YES;
313
+				GCC_OPTIMIZATION_LEVEL = 0;
314
+				GCC_PREPROCESSOR_DEFINITIONS = (
315
+					"DEBUG=1",
316
+					"$(inherited)",
317
+				);
318
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
319
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
320
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
321
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
322
+				GCC_WARN_UNUSED_FUNCTION = YES;
323
+				GCC_WARN_UNUSED_VARIABLE = YES;
324
+				IPHONEOS_DEPLOYMENT_TARGET = 10.3;
325
+				MTL_ENABLE_DEBUG_INFO = YES;
326
+				ONLY_ACTIVE_ARCH = YES;
327
+				SDKROOT = iphoneos;
328
+				TARGETED_DEVICE_FAMILY = "1,2";
329
+				VERSIONING_SYSTEM = "apple-generic";
330
+				VERSION_INFO_PREFIX = "";
331
+			};
332
+			name = Debug;
333
+		};
334
+		0BD906EC1EC0C00300C8C18E /* Release */ = {
335
+			isa = XCBuildConfiguration;
336
+			buildSettings = {
337
+				ALWAYS_SEARCH_USER_PATHS = NO;
338
+				CLANG_ANALYZER_NONNULL = YES;
339
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
340
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
341
+				CLANG_CXX_LIBRARY = "libc++";
342
+				CLANG_ENABLE_MODULES = YES;
343
+				CLANG_ENABLE_OBJC_ARC = YES;
344
+				CLANG_WARN_BOOL_CONVERSION = YES;
345
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
346
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
347
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
348
+				CLANG_WARN_EMPTY_BODY = YES;
349
+				CLANG_WARN_ENUM_CONVERSION = YES;
350
+				CLANG_WARN_INFINITE_RECURSION = YES;
351
+				CLANG_WARN_INT_CONVERSION = YES;
352
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
353
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
354
+				CLANG_WARN_UNREACHABLE_CODE = YES;
355
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
356
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
357
+				COPY_PHASE_STRIP = NO;
358
+				CURRENT_PROJECT_VERSION = 1;
359
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
360
+				ENABLE_BITCODE = NO;
361
+				ENABLE_NS_ASSERTIONS = NO;
362
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
363
+				GCC_C_LANGUAGE_STANDARD = gnu99;
364
+				GCC_NO_COMMON_BLOCKS = YES;
365
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
366
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
367
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
368
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
369
+				GCC_WARN_UNUSED_FUNCTION = YES;
370
+				GCC_WARN_UNUSED_VARIABLE = YES;
371
+				IPHONEOS_DEPLOYMENT_TARGET = 10.3;
372
+				MTL_ENABLE_DEBUG_INFO = NO;
373
+				SDKROOT = iphoneos;
374
+				TARGETED_DEVICE_FAMILY = "1,2";
375
+				VALIDATE_PRODUCT = YES;
376
+				VERSIONING_SYSTEM = "apple-generic";
377
+				VERSION_INFO_PREFIX = "";
378
+			};
379
+			name = Release;
380
+		};
381
+		0BD906EE1EC0C00300C8C18E /* Debug */ = {
382
+			isa = XCBuildConfiguration;
383
+			baseConfigurationReference = 062651321278D27A9BAEFAD4 /* Pods-JitsiMeet.debug.xcconfig */;
384
+			buildSettings = {
385
+				CODE_SIGN_IDENTITY = "iPhone Developer";
386
+				DEFINES_MODULE = YES;
387
+				DEVELOPMENT_TEAM = BQNXB4G3KQ;
388
+				DYLIB_COMPATIBILITY_VERSION = 1;
389
+				DYLIB_CURRENT_VERSION = 1;
390
+				DYLIB_INSTALL_NAME_BASE = "@rpath";
391
+				ENABLE_BITCODE = NO;
392
+				INFOPLIST_FILE = sdk/Info.plist;
393
+				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
394
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
395
+				PRODUCT_BUNDLE_IDENTIFIER = org.jitsi.JitsiKit;
396
+				PRODUCT_NAME = "$(TARGET_NAME)";
397
+				SKIP_INSTALL = YES;
398
+			};
399
+			name = Debug;
400
+		};
401
+		0BD906EF1EC0C00300C8C18E /* Release */ = {
402
+			isa = XCBuildConfiguration;
403
+			baseConfigurationReference = E358F7AEFCB4033712107DF5 /* Pods-JitsiMeet.release.xcconfig */;
404
+			buildSettings = {
405
+				CODE_SIGN_IDENTITY = "iPhone Developer";
406
+				DEFINES_MODULE = YES;
407
+				DEVELOPMENT_TEAM = BQNXB4G3KQ;
408
+				DYLIB_COMPATIBILITY_VERSION = 1;
409
+				DYLIB_CURRENT_VERSION = 1;
410
+				DYLIB_INSTALL_NAME_BASE = "@rpath";
411
+				ENABLE_BITCODE = NO;
412
+				INFOPLIST_FILE = sdk/Info.plist;
413
+				INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
414
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
415
+				PRODUCT_BUNDLE_IDENTIFIER = org.jitsi.JitsiKit;
416
+				PRODUCT_NAME = "$(TARGET_NAME)";
417
+				SKIP_INSTALL = YES;
418
+			};
419
+			name = Release;
420
+		};
421
+/* End XCBuildConfiguration section */
422
+
423
+/* Begin XCConfigurationList section */
424
+		0BD906DF1EC0C00300C8C18E /* Build configuration list for PBXProject "Jitsi Meet SDK" */ = {
425
+			isa = XCConfigurationList;
426
+			buildConfigurations = (
427
+				0BD906EB1EC0C00300C8C18E /* Debug */,
428
+				0BD906EC1EC0C00300C8C18E /* Release */,
429
+			);
430
+			defaultConfigurationIsVisible = 0;
431
+			defaultConfigurationName = Release;
432
+		};
433
+		0BD906ED1EC0C00300C8C18E /* Build configuration list for PBXNativeTarget "JitsiMeet" */ = {
434
+			isa = XCConfigurationList;
435
+			buildConfigurations = (
436
+				0BD906EE1EC0C00300C8C18E /* Debug */,
437
+				0BD906EF1EC0C00300C8C18E /* Release */,
438
+			);
439
+			defaultConfigurationIsVisible = 0;
440
+			defaultConfigurationName = Release;
441
+		};
442
+/* End XCConfigurationList section */
443
+	};
444
+	rootObject = 0BD906DC1EC0C00300C8C18E /* Project object */;
445
+}

+ 32
- 0
ios/Podfile View File

@@ -0,0 +1,32 @@
1
+platform :ios, '9.0'
2
+
3
+workspace 'jitsi-meet'
4
+project 'Jitsi Meet SDK.xcodeproj'
5
+
6
+target 'JitsiMeet' do
7
+  pod 'React', :path => '../node_modules/react-native', :subspecs => [
8
+    'Core',
9
+    'RCTActionSheet',
10
+    'RCTAnimation',
11
+    'RCTImage',
12
+    'RCTLinkingIOS',
13
+    'RCTNetwork',
14
+    'RCTText',
15
+    'RCTWebSocket',
16
+  ]
17
+  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
18
+
19
+  pod 'react-native-background-timer', :path => '../node_modules/react-native-background-timer'
20
+  pod 'react-native-keep-awake', :path => '../node_modules/react-native-keep-awake'
21
+  pod 'react-native-webrtc', :path => '../node_modules/react-native-webrtc'
22
+  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
23
+
24
+end
25
+
26
+post_install do |installer|
27
+  installer.pods_project.targets.each do |target|
28
+    target.build_configurations.each do |config|
29
+      config.build_settings['ENABLE_BITCODE'] = 'NO'
30
+    end
31
+  end
32
+end

+ 68
- 0
ios/README.md View File

@@ -0,0 +1,68 @@
1
+# Jitsi Meet SDK for iOS
2
+
3
+This directory contains the source code for Jitsi Meet for iOS (the application)
4
+and the Jitsi Meet SDK.
5
+
6
+## Jitsi Meet SDK
7
+
8
+JitsiMeet is an iOS framework which embodies the Jitsi Meet experience,
9
+gift-wrapped so other applications can use it. Using it is very simple. Use
10
+a Storyboard or Interface Builder to add a `JitsiMeetView` to your
11
+application.
12
+
13
+Then, once the view has loaded, set the delegate in your controller and load the
14
+desired URL:
15
+
16
+```objc
17
+- (void)viewDidLoad {
18
+  [super viewDidLoad];
19
+
20
+  JitsiMeetView *meetView = (JitsiMeetView*) self.view;
21
+  meetView.delegate = self;
22
+  [meetView loadURL:nil];
23
+}
24
+```
25
+
26
+### JitsiMeetView class
27
+
28
+The `JitsiMeetView` class is the entrypoint to the SDK. It a subclass of
29
+`UIView` which renders a full conference in the designated area.
30
+
31
+```objc
32
+[meetView loadURL:[NSURL URLWithString:@"https://meet.jit.si/test123"]];
33
+```
34
+
35
+Loads the given URL and joins the room. If `null` is specified the welcome page
36
+is displayed instead.
37
+
38
+#### Universal / deep linking
39
+
40
+In order to support universal / deep linking, `JitsiMeetView` offers 2 class
41
+methods that you application's delegate should call in order for the application
42
+to follow those links. Example:
43
+
44
+```objc
45
+- (BOOL)application:(UIApplication *)application
46
+continueUserActivity:(NSUserActivity *)userActivity
47
+ restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler
48
+{
49
+  return [JitsiMeetView application:application
50
+               continueUserActivity:userActivity
51
+                 restorationHandler:restorationHandler];
52
+ }
53
+
54
+- (BOOL)application:(UIApplication *)application
55
+            openURL:(NSURL *)url
56
+  sourceApplication:(NSString *)sourceApplication
57
+        annotation:(id)annotation
58
+{
59
+  return [JitsiMeetView application:application
60
+                            openURL:url
61
+                  sourceApplication:sourceApplication
62
+                         annotation:annotation];
63
+}
64
+```
65
+
66
+### JitsiMeetViewDelegate
67
+
68
+TODO.

+ 14
- 6
ios/app/AppDelegate.h View File

@@ -1,14 +1,22 @@
1
-/**
2
- * Copyright (c) 2015-present, Facebook, Inc.
3
- * All rights reserved.
1
+/*
2
+ * Copyright @ 2017-present Atlassian Pty Ltd
4 3
  *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
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.
8 15
  */
9 16
 
10 17
 #import <UIKit/UIKit.h>
11 18
 
19
+
12 20
 @interface AppDelegate : UIResponder <UIApplicationDelegate>
13 21
 
14 22
 @property (nonatomic, strong) UIWindow *window;

+ 28
- 78
ios/app/AppDelegate.m View File

@@ -1,101 +1,51 @@
1
-/**
2
- * Copyright (c) 2015-present, Facebook, Inc.
3
- * All rights reserved.
1
+/*
2
+ * Copyright @ 2017-present Atlassian Pty Ltd
4 3
  *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
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.
8 15
  */
9 16
 
10 17
 #import "AppDelegate.h"
11 18
 
12
-#import <React/RCTAssert.h>
13
-#import <React/RCTBundleURLProvider.h>
14
-#import <React/RCTLinkingManager.h>
15
-#import <React/RCTRootView.h>
19
+#import <JitsiMeet/JitsiMeet.h>
16 20
 
17
-/**
18
- * A <tt>RCTFatalHandler</tt> implementation which swallows JavaScript errors.
19
- * In the Release configuration, React Native will (intentionally) raise an
20
- * unhandled NSException for an unhandled JavaScript error. This will
21
- * effectively kill the application. <tt>_RCTFatal</tt> is suitable to be in
22
- * accord with the Web i.e. not kill the application.
23
- */
24
-RCTFatalHandler _RCTFatal = ^(NSError *error) {
25
-  id jsStackTrace = error.userInfo[RCTJSStackTraceKey];
26
-  @try {
27
-    NSString *name
28
-      = [NSString stringWithFormat:@"%@: %@",
29
-                  RCTFatalExceptionName,
30
-                  error.localizedDescription];
31
-    NSString *message
32
-      = RCTFormatError(error.localizedDescription, jsStackTrace, 75);
33
-    [NSException raise:name format:@"%@", message];
34
-  } @catch (NSException *e) {
35
-    if (!jsStackTrace) {
36
-      @throw;
37
-    }
38
-  }
39
-};
40 21
 
41 22
 @implementation AppDelegate
42 23
 
43
-// https://facebook.github.io/react-native/docs/linking.html
44 24
 - (BOOL)application:(UIApplication *)application
45
-continueUserActivity:(NSUserActivity *)userActivity
46
- restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler
47
-{
48
-  return [RCTLinkingManager application:application
49
-                   continueUserActivity:userActivity
50
-                     restorationHandler:restorationHandler];
25
+    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
26
+  return YES;
51 27
 }
52 28
 
29
+#pragma mark linking delegate methods
30
+
53 31
 - (BOOL)application:(UIApplication *)application
54
-didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
32
+continueUserActivity:(NSUserActivity *)userActivity
33
+ restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler
55 34
 {
56
-#if !DEBUG
57
-  // In the Release configuration, React Native will (intentionally) raise an
58
-  // unhandled NSException for an unhandled JavaScript error. This will
59
-  // effectively kill the application. In accord with the Web, do not kill the
60
-  // application.
61
-  if (!RCTGetFatalHandler()) {
62
-    RCTSetFatalHandler(_RCTFatal);
63
-  }
64
-#endif
65
-
66
-  NSURL *jsCodeLocation
67
-    = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios"
68
-                                                     fallbackResource:nil];
69
-  RCTRootView *rootView
70
-    = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
71
-                                  moduleName:@"App"
72
-                           initialProperties:nil
73
-                               launchOptions:launchOptions];
74
-
75
-  // Set a background color which is in accord with the JavaScript and Android
76
-  // parts of the application and causes less perceived visual flicker than the
77
-  // default background color.
78
-  rootView.backgroundColor
79
-    = [[UIColor alloc] initWithRed:.07f green:.07f blue:.07f alpha:1];
80
-
81
-  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
82
-  UIViewController *rootViewController = [UIViewController new];
83
-  rootViewController.view = rootView;
84
-  self.window.rootViewController = rootViewController;
85
-  [self.window makeKeyAndVisible];
86
-  return YES;
87
-}
35
+  return [JitsiMeetView application:application
36
+                  continueUserActivity:userActivity
37
+                    restorationHandler:restorationHandler];
38
+ }
88 39
 
89
-// https://facebook.github.io/react-native/docs/linking.html
90 40
 - (BOOL)application:(UIApplication *)application
91 41
             openURL:(NSURL *)url
92 42
   sourceApplication:(NSString *)sourceApplication
93 43
         annotation:(id)annotation
94 44
 {
95
-  return [RCTLinkingManager application:application
96
-                                openURL:url
97
-                      sourceApplication:sourceApplication
98
-                             annotation:annotation];
45
+  return [JitsiMeetView application:application
46
+                            openURL:url
47
+                  sourceApplication:sourceApplication
48
+                         annotation:annotation];
99 49
 }
100 50
 
101 51
 @end

+ 30
- 0
ios/app/Base.lproj/Main.storyboard View File

@@ -0,0 +1,30 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="u7g-vg-A8m">
3
+    <device id="retina4_7" orientation="portrait">
4
+        <adaptation id="fullscreen"/>
5
+    </device>
6
+    <dependencies>
7
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
8
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
9
+    </dependencies>
10
+    <scenes>
11
+        <!--View Controller-->
12
+        <scene sceneID="xSm-U5-Hdu">
13
+            <objects>
14
+                <viewController id="u7g-vg-A8m" customClass="ViewController" sceneMemberID="viewController">
15
+                    <layoutGuides>
16
+                        <viewControllerLayoutGuide type="top" id="d40-fc-Y8P"/>
17
+                        <viewControllerLayoutGuide type="bottom" id="1KD-Ho-g0H"/>
18
+                    </layoutGuides>
19
+                    <view key="view" contentMode="scaleToFill" id="QpR-jB-WOw" customClass="JitsiMeetView">
20
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
21
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
22
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
23
+                    </view>
24
+                </viewController>
25
+                <placeholder placeholderIdentifier="IBFirstResponder" id="ZIj-K3-jVH" userLabel="First Responder" sceneMemberID="firstResponder"/>
26
+            </objects>
27
+            <point key="canvasLocation" x="28" y="138"/>
28
+        </scene>
29
+    </scenes>
30
+</document>

+ 2
- 5
ios/app/Info.plist View File

@@ -61,17 +61,14 @@
61 61
 	<string></string>
62 62
 	<key>NSMicrophoneUsageDescription</key>
63 63
 	<string>Participate in conferences with audio.</string>
64
-	<key>UIAppFonts</key>
65
-	<array>
66
-		<string>jitsi.ttf</string>
67
-		<string>FontAwesome.ttf</string>
68
-	</array>
69 64
 	<key>UIBackgroundModes</key>
70 65
 	<array>
71 66
 		<string>audio</string>
72 67
 		<string>fetch</string>
73 68
 		<string>voip</string>
74 69
 	</array>
70
+	<key>UIMainStoryboardFile</key>
71
+	<string>Main</string>
75 72
 	<key>UILaunchStoryboardName</key>
76 73
 	<string>LaunchScreen</string>
77 74
 	<key>UIRequiredDeviceCapabilities</key>

+ 0
- 24
ios/app/Proximity.m View File

@@ -1,24 +0,0 @@
1
-#import "RCTBridgeModule.h"
2
-
3
-#import <UIKit/UIKit.h>
4
-
5
-@interface Proximity : NSObject<RCTBridgeModule>
6
-@end
7
-
8
-@implementation Proximity
9
-
10
-RCT_EXPORT_MODULE();
11
-
12
-/**
13
- * Enables / disables the proximity sensor monitoring. On iOS enabling the
14
- * proximity sensor automatically dims the screen and disables touch controls,
15
- * so there is nothing else to do (unlike on Android)!
16
- *
17
- * @param enabled {@code YES} to enable proximity (sensor) monitoring;
18
- * {@code NO}, otherwise.
19
- */
20
-RCT_EXPORT_METHOD(setEnabled:(BOOL)enabled) {
21
-    [[UIDevice currentDevice] setProximityMonitoringEnabled:enabled];
22
-}
23
-
24
-@end

+ 24
- 0
ios/app/ViewController.h View File

@@ -0,0 +1,24 @@
1
+/*
2
+ * Copyright @ 2017-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 <UIKit/UIKit.h>
18
+
19
+#import <JitsiMeet/JitsiMeet.h>
20
+
21
+
22
+@interface ViewController : UIViewController<JitsiMeetViewDelegate>
23
+
24
+@end

+ 37
- 0
ios/app/ViewController.m View File

@@ -0,0 +1,37 @@
1
+/*
2
+ * Copyright @ 2017-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 "ViewController.h"
18
+
19
+@interface ViewController ()
20
+
21
+@end
22
+
23
+@implementation ViewController
24
+
25
+- (void)viewDidLoad {
26
+  [super viewDidLoad];
27
+
28
+  JitsiMeetView *meetView = (JitsiMeetView*) self.view;
29
+  meetView.delegate = self;
30
+  [meetView loadURL:nil];
31
+}
32
+
33
+- (void)didReceiveMemoryWarning {
34
+    [super didReceiveMemoryWarning];
35
+}
36
+
37
+@end

+ 13
- 6
ios/app/main.m View File

@@ -1,10 +1,17 @@
1
-/**
2
- * Copyright (c) 2015-present, Facebook, Inc.
3
- * All rights reserved.
1
+/*
2
+ * Copyright @ 2017-present Atlassian Pty Ltd
4 3
  *
5
- * This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
7
- * of patent rights can be found in the PATENTS file in the same directory.
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.
8 15
  */
9 16
 
10 17
 #import <UIKit/UIKit.h>

+ 55
- 821
ios/jitsi-meet.xcodeproj/project.pbxproj
File diff suppressed because it is too large
View File


+ 4
- 4
ios/jitsi-meet.xcodeproj/xcshareddata/xcschemes/jitsi-meet.xcscheme View File

@@ -14,10 +14,10 @@
14 14
             buildForAnalyzing = "YES">
15 15
             <BuildableReference
16 16
                BuildableIdentifier = "primary"
17
-               BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192"
18
-               BuildableName = "libReact.a"
19
-               BlueprintName = "React"
20
-               ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
17
+               BlueprintIdentifier = "0BD906E41EC0C00300C8C18E"
18
+               BuildableName = "JitsiMeet.framework"
19
+               BlueprintName = "JitsiMeet"
20
+               ReferencedContainer = "container:Jitsi Meet SDK.xcodeproj">
21 21
             </BuildableReference>
22 22
          </BuildActionEntry>
23 23
          <BuildActionEntry

+ 6
- 0
ios/jitsi-meet.xcworkspace/contents.xcworkspacedata View File

@@ -1,7 +1,13 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <Workspace
3 3
    version = "1.0">
4
+   <FileRef
5
+      location = "group:Jitsi Meet SDK.xcodeproj">
6
+   </FileRef>
4 7
    <FileRef
5 8
       location = "group:jitsi-meet.xcodeproj">
6 9
    </FileRef>
10
+   <FileRef
11
+      location = "group:Pods/Pods.xcodeproj">
12
+   </FileRef>
7 13
 </Workspace>

ios/app/AudioMode.m → ios/sdk/AudioMode.m View File

@@ -1,3 +1,19 @@
1
+/*
2
+ * Copyright @ 2017-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
+
1 17
 #import "RCTBridgeModule.h"
2 18
 #import "RCTLog.h"
3 19
 

+ 29
- 0
ios/sdk/Info.plist View File

@@ -0,0 +1,29 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+<plist version="1.0">
4
+<dict>
5
+	<key>CFBundleDevelopmentRegion</key>
6
+	<string>en</string>
7
+	<key>CFBundleExecutable</key>
8
+	<string>$(EXECUTABLE_NAME)</string>
9
+	<key>CFBundleIdentifier</key>
10
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11
+	<key>CFBundleInfoDictionaryVersion</key>
12
+	<string>6.0</string>
13
+	<key>CFBundleName</key>
14
+	<string>$(PRODUCT_NAME)</string>
15
+	<key>CFBundlePackageType</key>
16
+	<string>FMWK</string>
17
+	<key>CFBundleShortVersionString</key>
18
+	<string>1.0</string>
19
+	<key>CFBundleVersion</key>
20
+	<string>$(CURRENT_PROJECT_VERSION)</string>
21
+	<key>NSPrincipalClass</key>
22
+	<string></string>
23
+    <key>JitsiKitFonts</key>
24
+    <array>
25
+        <string>jitsi.ttf</string>
26
+        <string>FontAwesome.ttf</string>
27
+    </array>
28
+</dict>
29
+</plist>

+ 18
- 0
ios/sdk/JitsiMeet.h View File

@@ -0,0 +1,18 @@
1
+/*
2
+ * Copyright @ 2017-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 <JitsiMeet/JitsiMeetView.h>
18
+#import <JitsiMeet/JitsiMeetViewDelegate.h>

+ 38
- 0
ios/sdk/JitsiMeetView.h View File

@@ -0,0 +1,38 @@
1
+/*
2
+ * Copyright @ 2017-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 <Foundation/Foundation.h>
18
+#import <UIKit/UIKit.h>
19
+
20
+#import "JitsiMeetViewDelegate.h"
21
+
22
+
23
+@interface JitsiMeetView : UIView
24
+
25
+@property (nonatomic, weak, nullable) id<JitsiMeetViewDelegate> delegate;
26
+
27
++ (BOOL)application:(UIApplication *)application
28
+continueUserActivity:(NSUserActivity *)userActivity
29
+ restorationHandler:(void (^)(NSArray *))restorationHandler;
30
+
31
++ (BOOL)application:(UIApplication *)application
32
+            openURL:(NSURL *)URL
33
+  sourceApplication:(NSString *)sourceApplication
34
+         annotation:(id)annotation;
35
+
36
+- (void)loadURL:(nullable NSURL *)url;
37
+
38
+@end

+ 212
- 0
ios/sdk/JitsiMeetView.m View File

@@ -0,0 +1,212 @@
1
+/*
2
+ * Copyright @ 2017-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 <CoreText/CoreText.h>
18
+
19
+#import <React/RCTAssert.h>
20
+#import <React/RCTLinkingManager.h>
21
+#import <React/RCTRootView.h>
22
+
23
+#import "JitsiMeetView.h"
24
+#import "JitsiRCTBridgeWrapper.h"
25
+
26
+
27
+/**
28
+ * A <tt>RCTFatalHandler</tt> implementation which swallows JavaScript errors.
29
+ * In the Release configuration, React Native will (intentionally) raise an
30
+ * unhandled NSException for an unhandled JavaScript error. This will
31
+ * effectively kill the application. <tt>_RCTFatal</tt> is suitable to be in
32
+ * accord with the Web i.e. not kill the application.
33
+ */
34
+RCTFatalHandler _RCTFatal = ^(NSError *error)
35
+{
36
+    id jsStackTrace = error.userInfo[RCTJSStackTraceKey];
37
+    @try {
38
+        NSString *name
39
+            = [NSString stringWithFormat:@"%@: %@",
40
+               RCTFatalExceptionName, error.localizedDescription];
41
+        NSString *message
42
+            = RCTFormatError(error.localizedDescription, jsStackTrace, 75);
43
+        [NSException raise:name format:@"%@", message];
44
+    } @catch (NSException *e) {
45
+        if (!jsStackTrace) {
46
+            @throw;
47
+        }
48
+    }
49
+};
50
+
51
+
52
+@interface JitsiMeetView() {
53
+    RCTRootView *rootView;
54
+}
55
+
56
+@end
57
+
58
+
59
+@implementation JitsiMeetView
60
+
61
+static JitsiRCTBridgeWrapper *jitsiBridge;
62
+
63
+
64
+#pragma mark linking delegate helpers
65
+// https://facebook.github.io/react-native/docs/linking.html
66
+
67
++ (BOOL)application:(UIApplication *)application
68
+continueUserActivity:(NSUserActivity *)userActivity
69
+ restorationHandler:(void (^)(NSArray *restorableObjects))restorationHandler
70
+{
71
+    return [RCTLinkingManager application:application
72
+                     continueUserActivity:userActivity
73
+                       restorationHandler:restorationHandler];
74
+}
75
+
76
++ (BOOL)application:(UIApplication *)application
77
+            openURL:(NSURL *)url
78
+  sourceApplication:(NSString *)sourceApplication
79
+         annotation:(id)annotation
80
+{
81
+    return [RCTLinkingManager application:application
82
+                                  openURL:url
83
+                        sourceApplication:sourceApplication
84
+                               annotation:annotation];
85
+}
86
+
87
+#pragma mark initializers
88
+
89
+- (instancetype)initWithFrame:(CGRect)frame
90
+{
91
+    self = [super initWithFrame:frame];
92
+    if (self) {
93
+        [self initialize];
94
+    }
95
+
96
+    return self;
97
+}
98
+
99
+- (instancetype)initWithCoder:(NSCoder *)aDecoder
100
+{
101
+    self = [super initWithCoder:aDecoder];
102
+    if (self) {
103
+        [self initialize];
104
+    }
105
+
106
+    return self;
107
+}
108
+
109
+#pragma mark API
110
+
111
+/*
112
+ * Loads the given URL and joins the specified conference. If the specified URL
113
+ * is null, the welcome page is shown.
114
+ */
115
+- (void)loadURL:(NSURL *)url
116
+{
117
+    NSDictionary *props = url ? @{ url : url.absoluteString } : nil;
118
+    if (rootView == nil) {
119
+        rootView
120
+            = [[RCTRootView alloc] initWithBridge:jitsiBridge.bridge
121
+                                       moduleName:@"App"
122
+                                initialProperties:props];
123
+        rootView.backgroundColor = self.backgroundColor;
124
+
125
+        // Add React's root view as a subview which completely covers this one.
126
+        [rootView setFrame:[self bounds]];
127
+        [self addSubview:rootView];
128
+    } else {
129
+        // Update props with the new URL
130
+        rootView.appProperties = props;
131
+    }
132
+}
133
+
134
+#pragma mark private methods
135
+
136
+/*
137
+ * Internal initialization:
138
+ *
139
+ *   - sets the backgroudn color
140
+ *   - creates the React bridge
141
+ *   - loads the necessary custom fonts
142
+ *   - registers a custom fatal error error handler for React
143
+ */
144
+- (void)initialize
145
+{
146
+    static dispatch_once_t onceToken;
147
+
148
+    dispatch_once(&onceToken, ^{
149
+        // Set a background color which is in accord with the JavaScript and
150
+        // Android parts of the application and causes less perceived visual
151
+        // flicker than the default background color.
152
+        self.backgroundColor
153
+            = [UIColor colorWithRed:.07f green:.07f blue:.07f alpha:1];
154
+
155
+        // Initialize the React bridge.
156
+        jitsiBridge = [[JitsiRCTBridgeWrapper alloc] init];
157
+
158
+        // Dynamically load custom bundled fonts.
159
+        [self loadCustomFonts];
160
+
161
+        // Register a fatal error handler for React.
162
+        [self registerFatalErrorHandler];
163
+    });
164
+}
165
+
166
+/*
167
+ * Helper function to dynamically load custom fonts. The UIAppFonts key in the
168
+ * plist file doesn't work for frameworks, so fonts have to be manually loaded.
169
+ */
170
+- (void)loadCustomFonts
171
+{
172
+    NSBundle *bundle = [NSBundle bundleForClass:self.class];
173
+    NSArray *fonts = [bundle objectForInfoDictionaryKey:@"JitsiKitFonts"];
174
+
175
+    for (NSString *item in fonts) {
176
+        NSString *fontName = [item stringByDeletingPathExtension];
177
+        NSString *fontExt = [item pathExtension];
178
+        NSString *fontPath = [bundle pathForResource:fontName ofType:fontExt];
179
+        NSData *inData = [NSData dataWithContentsOfFile:fontPath];
180
+        CFErrorRef error;
181
+        CGDataProviderRef provider
182
+            = CGDataProviderCreateWithCFData((__bridge CFDataRef)inData);
183
+        CGFontRef font = CGFontCreateWithDataProvider(provider);
184
+        if (!CTFontManagerRegisterGraphicsFont(font, &error)) {
185
+            CFStringRef errorDescription = CFErrorCopyDescription(error);
186
+            NSLog(@"Failed to load font: %@", errorDescription);
187
+            CFRelease(errorDescription);
188
+        }
189
+        CFRelease(font);
190
+        CFRelease(provider);
191
+    }
192
+}
193
+
194
+/*
195
+ * Helper function to register a fatal error handler for React. Our handler
196
+ * won't kill the process, it will swallow JS errors and print stack traces
197
+ * instead.
198
+ */
199
+- (void)registerFatalErrorHandler
200
+{
201
+#if !DEBUG
202
+    // In the Release configuration, React Native will (intentionally) raise
203
+    // an unhandled NSException for an unhandled JavaScript error. This will
204
+    // effectively kill the application. In accord with the Web, do not kill
205
+    // the application.
206
+    if (!RCTGetFatalHandler()) {
207
+        RCTSetFatalHandler(_RCTFatal);
208
+    }
209
+#endif
210
+}
211
+
212
+@end

+ 21
- 0
ios/sdk/JitsiMeetViewDelegate.h View File

@@ -0,0 +1,21 @@
1
+/*
2
+ * Copyright @ 2017-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
+@protocol JitsiMeetViewDelegate <NSObject>
18
+
19
+// TODO: add delegate methods
20
+
21
+@end

+ 37
- 0
ios/sdk/JitsiRCTBridgeWrapper.h View File

@@ -0,0 +1,37 @@
1
+/*
2
+ * Copyright @ 2017-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 <Foundation/Foundation.h>
18
+
19
+#import <React/RCTBridge.h>
20
+#import <React/RCTBridgeDelegate.h>
21
+
22
+/**
23
+ * A wrapper around the <tt>RCTBridge</tt> which implements the delegate methods
24
+ * that allow us to serve the JS bundle from within the framework's resources
25
+ * directory. This is the recommended way for those cases where the builtin API
26
+ * doesn't cut it, as is the case.
27
+ *
28
+ * In addition, we will create a single bridge and then create all root views
29
+ * off it, thus only loading the JS bundle a single time. This class is not a
30
+ * singleton, however, so it's possible for us to create multiple instances of
31
+ * it, though that's not currently used.
32
+ */
33
+@interface JitsiRCTBridgeWrapper : NSObject<RCTBridgeDelegate>
34
+
35
+@property (nonatomic, readonly, strong)  RCTBridge *bridge;
36
+
37
+@end

+ 119
- 0
ios/sdk/JitsiRTCBridgeWrapper.m View File

@@ -0,0 +1,119 @@
1
+/*
2
+ * Copyright @ 2017-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
+#include "JitsiRCTBridgeWrapper.h"
18
+
19
+/*
20
+ * Wrapper around RCTBridge which also implements the RCTBridgeDelegate methods,
21
+ * allowing us to specify where the bundles are loaded from.
22
+ */
23
+@implementation JitsiRCTBridgeWrapper
24
+
25
+- (instancetype)init
26
+{
27
+    self = [super init];
28
+
29
+    if (self) {
30
+        _bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:nil];
31
+    }
32
+
33
+    return self;
34
+}
35
+
36
+#pragma mark helper methods for getting the packager URL
37
+
38
+#if DEBUG
39
+static NSURL *serverRootWithHost(NSString *host)
40
+{
41
+    return [NSURL URLWithString:
42
+            [NSString stringWithFormat:@"http://%@:8081/", host]];
43
+}
44
+
45
+- (BOOL)isPackagerRunning:(NSString *)host
46
+{
47
+    NSURL *url = [serverRootWithHost(host)
48
+                  URLByAppendingPathComponent:@"status"];
49
+    NSURLRequest *request = [NSURLRequest requestWithURL:url];
50
+    NSURLResponse *response;
51
+    NSData *data = [NSURLConnection sendSynchronousRequest:request
52
+                                         returningResponse:&response
53
+                                                     error:NULL];
54
+    NSString *status = [[NSString alloc] initWithData:data
55
+                                             encoding:NSUTF8StringEncoding];
56
+    return [status isEqualToString:@"packager-status:running"];
57
+}
58
+
59
+- (NSString *)guessPackagerHost
60
+{
61
+    static NSString *ipGuess;
62
+    static dispatch_once_t onceToken;
63
+    dispatch_once(&onceToken, ^{
64
+        NSString *ipPath = [[NSBundle bundleForClass:self.class]
65
+                            pathForResource:@"ip" ofType:@"txt"];
66
+        ipGuess = [[NSString stringWithContentsOfFile:ipPath
67
+                                             encoding:NSUTF8StringEncoding
68
+                                                error:nil]
69
+                   stringByTrimmingCharactersInSet:
70
+                   [NSCharacterSet newlineCharacterSet]];
71
+    });
72
+
73
+    NSString *host = ipGuess ?: @"localhost";
74
+    if ([self isPackagerRunning:host]) {
75
+        return host;
76
+    }
77
+
78
+    return nil;
79
+}
80
+#endif
81
+
82
+#pragma mark RCTBridgeDelegate methods
83
+
84
+- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
85
+{
86
+#if DEBUG
87
+    /*
88
+     * In debug mode, try to fetch the bundle from the packager, or fallback to
89
+     * the one inside the framework. The IP address for the packager host is
90
+     * fetched from the ip.txt file inside the framework.
91
+     *
92
+     * This duplicates some functionality present in RCTBundleURLProvider, but
93
+     * that mode is not designed to work inside a framework, because all
94
+     * resources are loaded from the main bundle.
95
+     */
96
+    NSString *host = [self guessPackagerHost];
97
+    if (host != nil) {
98
+        NSString *path = @"/index.ios.bundle";
99
+        NSString *query = @"platform=ios&dev=true&minify=false";
100
+        NSURLComponents *components
101
+        = [NSURLComponents componentsWithURL:serverRootWithHost(host)
102
+                     resolvingAgainstBaseURL:NO];
103
+        components.path = path;
104
+        components.query = query;
105
+
106
+        return components.URL;
107
+    }
108
+#endif
109
+
110
+    return [self fallbackSourceURLForBridge:bridge];
111
+}
112
+
113
+- (NSURL *)fallbackSourceURLForBridge:(RCTBridge *)bridge
114
+{
115
+    return [[NSBundle bundleForClass:self.class] URLForResource:@"main"
116
+                                                  withExtension:@"jsbundle"];
117
+}
118
+
119
+@end

ios/app/POSIX.m → ios/sdk/POSIX.m View File

@@ -1,3 +1,19 @@
1
+/*
2
+ * Copyright @ 2017-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
+
1 17
 #import "RCTBridgeModule.h"
2 18
 
3 19
 #include <arpa/inet.h>

+ 40
- 0
ios/sdk/Proximity.m View File

@@ -0,0 +1,40 @@
1
+/*
2
+ * Copyright @ 2017-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 "RCTBridgeModule.h"
18
+
19
+#import <UIKit/UIKit.h>
20
+
21
+@interface Proximity : NSObject<RCTBridgeModule>
22
+@end
23
+
24
+@implementation Proximity
25
+
26
+RCT_EXPORT_MODULE();
27
+
28
+/**
29
+ * Enables / disables the proximity sensor monitoring. On iOS enabling the
30
+ * proximity sensor automatically dims the screen and disables touch controls,
31
+ * so there is nothing else to do (unlike on Android)!
32
+ *
33
+ * @param enabled {@code YES} to enable proximity (sensor) monitoring;
34
+ * {@code NO}, otherwise.
35
+ */
36
+RCT_EXPORT_METHOD(setEnabled:(BOOL)enabled) {
37
+    [[UIDevice currentDevice] setProximityMonitoringEnabled:enabled];
38
+}
39
+
40
+@end

+ 36
- 0
ios/utils/fixup-ats.sh View File

@@ -0,0 +1,36 @@
1
+#!/bin/bash
2
+
3
+# This script gets executed from Xcode to disable ATS (App Transport Security)
4
+# on Debug builds. Doing this allows loading resources over HTTP, such as the
5
+# JS bundle.
6
+
7
+
8
+set -x
9
+
10
+case "$CONFIGURATION" in
11
+  Debug)
12
+    # Speed up build times by skipping the creation of the offline package for debug
13
+    # builds on the simulator since the packager is supposed to be running anyways.
14
+    if [[ "$PLATFORM_NAME" == *simulator ]]; then
15
+      echo "Skipping bundling for Simulator platform"
16
+      exit 0;
17
+    fi
18
+
19
+    DEV=true
20
+    ;;
21
+  "")
22
+    echo "$0 must be invoked by Xcode"
23
+    exit 1
24
+    ;;
25
+  *)
26
+    DEV=false
27
+    ;;
28
+esac
29
+
30
+DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH
31
+
32
+if [[ "$CONFIGURATION" = "Debug" && ! "$PLATFORM_NAME" == *simulator ]]; then
33
+  PLISTBUDDY='/usr/libexec/PlistBuddy'
34
+  PLIST=$TARGET_BUILD_DIR/$INFOPLIST_PATH
35
+  `$PLISTBUDDY -c "Add NSAppTransportSecurity:NSAllowsArbitraryLoads bool true" "$PLIST"` || true
36
+fi

+ 39
- 0
ios/utils/fixup-frameworks.sh View File

@@ -0,0 +1,39 @@
1
+#!/bin/bash
2
+
3
+# This script gets executed from Xcode to fixup the embedded frameworks and
4
+# bundle the necessary architectures.
5
+
6
+
7
+APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
8
+
9
+# This script loops through the frameworks embedded in the application and
10
+# removes unused architectures.
11
+find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
12
+do
13
+    FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
14
+    FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
15
+    echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
16
+
17
+    EXTRACTED_ARCHS=()
18
+
19
+    for ARCH in $ARCHS
20
+    do
21
+        if lipo -info "$FRAMEWORK_EXECUTABLE_PATH" | grep -q -v "^Non-fat"
22
+        then
23
+            echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
24
+            lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
25
+            EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
26
+        fi
27
+    done
28
+
29
+    if [ -n "$EXTRACTED_ARCHS" ]
30
+    then
31
+        echo "Merging extracted architectures: ${ARCHS}"
32
+        lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
33
+        rm "${EXTRACTED_ARCHS[@]}"
34
+
35
+        echo "Replacing original executable with thinned version"
36
+        rm "$FRAMEWORK_EXECUTABLE_PATH"
37
+        mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"
38
+    fi
39
+done

+ 16
- 0
ios/utils/run-packager.sh View File

@@ -0,0 +1,16 @@
1
+#!/bin/bash
2
+
3
+# This script is executed from Xcode to start the React packager for Debug
4
+# targets.
5
+
6
+
7
+if [[ "$CONFIGURATION" = "Debug" ]]; then
8
+  if nc -w 5 -z localhost 8081 ; then
9
+    if ! curl -s "http://localhost:8081/status" | grep -q "packager-status:running" ; then
10
+      echo "Port 8081 already in use, packager is either not running or not running correctly"
11
+      exit 2
12
+    fi
13
+  else
14
+    open "$SRCROOT/../node_modules/react-native/packager/launchPackager.command" || echo "Can't start packager automatically"
15
+  fi
16
+fi

Loading…
Cancel
Save