Parcourir la source

rn: add Firebase integration

This is done at the app level, not the SDK.

Currently 2 Firebase services are used:

  - Crashlytics
  - Dynamic Links

They are enabled in tandem, if the appropriate Google services file
(GoogleService-Info.plist on iOS or google-services.json on Android) is found.

Each service needs to be individually enabled in the Firebase console.
master
Saúl Ibarra Corretgé il y a 6 ans
Parent
révision
148d4ebb90

+ 24
- 2
android/app/build.gradle Voir le fichier

@@ -1,5 +1,14 @@
1 1
 apply plugin: 'com.android.application'
2 2
 
3
+boolean googleServicesEnabled = project.file('google-services.json').exists()
4
+
5
+// Crashlytics integration is done as part of Firebase now, so it gets
6
+// automagically activated with google-services.json
7
+if (googleServicesEnabled) {
8
+    apply plugin: 'io.fabric'
9
+}
10
+
11
+
3 12
 android {
4 13
     compileSdkVersion rootProject.ext.compileSdkVersion
5 14
     buildToolsVersion rootProject.ext.buildToolsVersion
@@ -31,10 +40,12 @@ android {
31 40
         debug {
32 41
             minifyEnabled true
33 42
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules-debug.pro'
43
+            buildConfigField "boolean", "GOOGLE_SERVICES_ENABLED", "${googleServicesEnabled}"
34 44
         }
35 45
         release {
36 46
             minifyEnabled true
37 47
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules-release.pro'
48
+            buildConfigField "boolean", "GOOGLE_SERVICES_ENABLED", "${googleServicesEnabled}"
38 49
         }
39 50
     }
40 51
 
@@ -44,11 +55,15 @@ android {
44 55
     }
45 56
 }
46 57
 
58
+repositories {
59
+    maven { url 'https://maven.fabric.io/public' }
60
+}
61
+
47 62
 dependencies {
48 63
     implementation fileTree(dir: 'libs', include: ['*.jar'])
49 64
     implementation "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"
50 65
     implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
51
-    implementation 'com.google.android.gms:play-services-auth:15.0.0'
66
+    implementation 'com.google.android.gms:play-services-auth:16.0.1'
52 67
 
53 68
     implementation project(':sdk')
54 69
 
@@ -63,6 +78,13 @@ dependencies {
63 78
         exclude group: "com.android.support", module: "annotations"
64 79
     }
65 80
     annotationProcessor "com.github.bumptech.glide:compiler:${rootProject.ext.glideVersion}"
81
+
82
+    // Firebase
83
+    //  - Crashlytics
84
+    //  - Dynamic Links
85
+    implementation 'com.google.firebase:firebase-core:16.0.6'
86
+    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
87
+    implementation 'com.google.firebase:firebase-dynamic-links:16.1.5'
66 88
 }
67 89
 
68 90
 gradle.projectsEvaluated {
@@ -117,6 +139,6 @@ gradle.projectsEvaluated {
117 139
     }
118 140
 }
119 141
 
120
-if (project.file('google-services.json').exists()) {
142
+if (googleServicesEnabled) {
121 143
    apply plugin: 'com.google.gms.google-services'
122 144
 }

+ 1
- 0
android/app/src/main/AndroidManifest.xml Voir le fichier

@@ -16,6 +16,7 @@
16 16
         android:resizeableActivity="true"
17 17
         android:supportsPictureInPicture="true"
18 18
         android:windowSoftInputMode="adjustResize">
19
+      <meta-data android:name="firebase_crashlytics_collection_enabled" android:value="false" />
19 20
       <intent-filter>
20 21
         <action android:name="android.intent.action.MAIN" />
21 22
         <category android:name="android.intent.category.LAUNCHER" />

+ 30
- 1
android/app/src/main/java/org/jitsi/meet/MainActivity.java Voir le fichier

@@ -1,5 +1,6 @@
1 1
 /*
2
- * Copyright @ 2017-present Atlassian Pty Ltd
2
+ * Copyright @ 2018-present 8x8, Inc.
3
+ * Copyright @ 2017-2018 Atlassian Pty Ltd
3 4
  *
4 5
  * Licensed under the Apache License, Version 2.0 (the "License");
5 6
  * you may not use this file except in compliance with the License.
@@ -16,6 +17,7 @@
16 17
 
17 18
 package org.jitsi.meet;
18 19
 
20
+import android.net.Uri;
19 21
 import android.os.Bundle;
20 22
 import android.util.Log;
21 23
 
@@ -27,8 +29,13 @@ import org.jitsi.meet.sdk.invite.AddPeopleControllerListener;
27 29
 import org.jitsi.meet.sdk.invite.InviteController;
28 30
 import org.jitsi.meet.sdk.invite.InviteControllerListener;
29 31
 
32
+import com.crashlytics.android.Crashlytics;
30 33
 import com.facebook.react.bridge.UiThreadUtil;
34
+import com.google.firebase.dynamiclinks.FirebaseDynamicLinks;
35
+import io.fabric.sdk.android.Fabric;
31 36
 
37
+import java.net.MalformedURLException;
38
+import java.net.URL;
32 39
 import java.util.ArrayList;
33 40
 import java.util.List;
34 41
 import java.util.Map;
@@ -182,6 +189,28 @@ public class MainActivity extends JitsiMeetActivity {
182 189
         setWelcomePageEnabled(true);
183 190
 
184 191
         super.onCreate(savedInstanceState);
192
+
193
+        // Setup Crashlytics and Firebase Dynamic Links
194
+        if (BuildConfig.GOOGLE_SERVICES_ENABLED) {
195
+            Fabric.with(this, new Crashlytics());
196
+
197
+            FirebaseDynamicLinks.getInstance().getDynamicLink(getIntent())
198
+                .addOnSuccessListener(this, pendingDynamicLinkData -> {
199
+                    Uri dynamicLink = null;
200
+
201
+                    if (pendingDynamicLinkData != null) {
202
+                        dynamicLink = pendingDynamicLinkData.getLink();
203
+                    }
204
+
205
+                    if (dynamicLink != null) {
206
+                        try {
207
+                            loadURL(new URL(dynamicLink.toString()));
208
+                        } catch (MalformedURLException e) {
209
+                            Log.d("ReactNative", "Malformed dynamic link", e);
210
+                        }
211
+                    }
212
+                });
213
+        }
185 214
     }
186 215
 
187 216
     private void onInviteControllerBeginAddPeople(

+ 5
- 1
android/build.gradle Voir le fichier

@@ -7,10 +7,14 @@ buildscript {
7 7
     repositories {
8 8
         google()
9 9
         jcenter()
10
+        repositories {
11
+            maven { url 'https://maven.fabric.io/public' }
12
+        }
10 13
     }
11 14
     dependencies {
12 15
         classpath 'com.android.tools.build:gradle:3.2.1'
13
-        classpath 'com.google.gms:google-services:3.2.1'
16
+        classpath 'com.google.gms:google-services:4.2.0'
17
+        classpath 'io.fabric.tools:gradle:1.27.0'
14 18
 
15 19
         // NOTE: Do not place your application dependencies here; they belong
16 20
         // in the individual module build.gradle files.

+ 9
- 0
ios/Podfile Voir le fichier

@@ -2,6 +2,15 @@ platform :ios, '10.0'
2 2
 
3 3
 workspace 'jitsi-meet'
4 4
 
5
+target 'jitsi-meet' do
6
+  project 'app/app.xcodeproj'
7
+
8
+  pod 'Crashlytics'
9
+  pod 'Fabric'
10
+  pod 'Firebase/Core'
11
+  pod 'Firebase/DynamicLinks'
12
+end
13
+
5 14
 target 'JitsiMeet' do
6 15
   project 'sdk/sdk.xcodeproj'
7 16
 

+ 87
- 1
ios/Podfile.lock Voir le fichier

@@ -1,12 +1,49 @@
1 1
 PODS:
2 2
   - boost-for-react-native (1.63.0)
3
+  - Crashlytics (3.12.0):
4
+    - Fabric (~> 1.9.0)
3 5
   - DoubleConversion (1.1.6)
6
+  - Fabric (1.9.0)
7
+  - Firebase/Core (5.15.0):
8
+    - Firebase/CoreOnly
9
+    - FirebaseAnalytics (= 5.4.0)
10
+  - Firebase/CoreOnly (5.15.0):
11
+    - FirebaseCore (= 5.1.10)
12
+  - Firebase/DynamicLinks (5.15.0):
13
+    - Firebase/CoreOnly
14
+    - FirebaseDynamicLinks (= 3.3.0)
15
+  - FirebaseAnalytics (5.4.0):
16
+    - FirebaseCore (~> 5.1)
17
+    - FirebaseInstanceID (~> 3.3)
18
+    - GoogleAppMeasurement (= 5.4.0)
19
+    - GoogleUtilities/AppDelegateSwizzler (~> 5.2)
20
+    - GoogleUtilities/MethodSwizzler (~> 5.2)
21
+    - GoogleUtilities/Network (~> 5.2)
22
+    - "GoogleUtilities/NSData+zlib (~> 5.2)"
23
+    - nanopb (~> 0.3)
24
+  - FirebaseAnalyticsInterop (1.1.0)
25
+  - FirebaseCore (5.1.10):
26
+    - GoogleUtilities/Logger (~> 5.2)
27
+  - FirebaseDynamicLinks (3.3.0):
28
+    - FirebaseAnalytics (~> 5.1)
29
+    - FirebaseAnalyticsInterop (~> 1.0)
30
+    - FirebaseCore (~> 5.1)
31
+  - FirebaseInstanceID (3.3.0):
32
+    - FirebaseCore (~> 5.1)
33
+    - GoogleUtilities/Environment (~> 5.3)
34
+    - GoogleUtilities/UserDefaults (~> 5.3)
4 35
   - FLAnimatedImage (1.0.12)
5 36
   - Folly (2016.10.31.00):
6 37
     - boost-for-react-native
7 38
     - DoubleConversion
8 39
     - glog
9 40
   - glog (0.3.5)
41
+  - GoogleAppMeasurement (5.4.0):
42
+    - GoogleUtilities/AppDelegateSwizzler (~> 5.2)
43
+    - GoogleUtilities/MethodSwizzler (~> 5.2)
44
+    - GoogleUtilities/Network (~> 5.2)
45
+    - "GoogleUtilities/NSData+zlib (~> 5.2)"
46
+    - nanopb (~> 0.3)
10 47
   - GoogleSignIn (4.4.0):
11 48
     - "GoogleToolboxForMac/NSDictionary+URLArguments (~> 2.1)"
12 49
     - "GoogleToolboxForMac/NSString+URLArguments (~> 2.1)"
@@ -19,7 +56,30 @@ PODS:
19 56
     - GoogleToolboxForMac/Defines (= 2.2.0)
20 57
     - "GoogleToolboxForMac/NSString+URLArguments (= 2.2.0)"
21 58
   - "GoogleToolboxForMac/NSString+URLArguments (2.2.0)"
59
+  - GoogleUtilities/AppDelegateSwizzler (5.3.6):
60
+    - GoogleUtilities/Environment
61
+    - GoogleUtilities/Logger
62
+    - GoogleUtilities/Network
63
+  - GoogleUtilities/Environment (5.3.6)
64
+  - GoogleUtilities/Logger (5.3.6):
65
+    - GoogleUtilities/Environment
66
+  - GoogleUtilities/MethodSwizzler (5.3.6):
67
+    - GoogleUtilities/Logger
68
+  - GoogleUtilities/Network (5.3.6):
69
+    - GoogleUtilities/Logger
70
+    - "GoogleUtilities/NSData+zlib"
71
+    - GoogleUtilities/Reachability
72
+  - "GoogleUtilities/NSData+zlib (5.3.6)"
73
+  - GoogleUtilities/Reachability (5.3.6):
74
+    - GoogleUtilities/Logger
75
+  - GoogleUtilities/UserDefaults (5.3.6):
76
+    - GoogleUtilities/Logger
22 77
   - GTMSessionFetcher/Core (1.2.1)
78
+  - nanopb (0.3.901):
79
+    - nanopb/decode (= 0.3.901)
80
+    - nanopb/encode (= 0.3.901)
81
+  - nanopb/decode (0.3.901)
82
+  - nanopb/encode (0.3.901)
23 83
   - ObjectiveDropboxOfficial (3.9.2)
24 84
   - React (0.57.8):
25 85
     - React/Core (= 0.57.8)
@@ -92,7 +152,11 @@ PODS:
92 152
   - yoga (0.57.8.React)
93 153
 
94 154
 DEPENDENCIES:
155
+  - Crashlytics
95 156
   - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
157
+  - Fabric
158
+  - Firebase/Core
159
+  - Firebase/DynamicLinks
96 160
   - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
97 161
   - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
98 162
   - ObjectiveDropboxOfficial
@@ -119,10 +183,21 @@ DEPENDENCIES:
119 183
 SPEC REPOS:
120 184
   https://github.com/cocoapods/specs.git:
121 185
     - boost-for-react-native
186
+    - Crashlytics
187
+    - Fabric
188
+    - Firebase
189
+    - FirebaseAnalytics
190
+    - FirebaseAnalyticsInterop
191
+    - FirebaseCore
192
+    - FirebaseDynamicLinks
193
+    - FirebaseInstanceID
122 194
     - FLAnimatedImage
195
+    - GoogleAppMeasurement
123 196
     - GoogleSignIn
124 197
     - GoogleToolboxForMac
198
+    - GoogleUtilities
125 199
     - GTMSessionFetcher
200
+    - nanopb
126 201
     - ObjectiveDropboxOfficial
127 202
     - SDWebImage
128 203
 
@@ -156,13 +231,24 @@ EXTERNAL SOURCES:
156 231
 
157 232
 SPEC CHECKSUMS:
158 233
   boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
234
+  Crashlytics: 07fb167b1694128c1c9a5a5cc319b0e9c3ca0933
159 235
   DoubleConversion: bb338842f62ab1d708ceb63ec3d999f0f3d98ecd
236
+  Fabric: f988e33c97f08930a413e08123064d2e5f68d655
237
+  Firebase: 8bb9268bff82374f2cbaaabb143e725743c316ae
238
+  FirebaseAnalytics: c06f9d70577d79074214700a71fd5d39de5550fb
239
+  FirebaseAnalyticsInterop: e5f21be9af6548372e2f0815834ff909bff395a2
240
+  FirebaseCore: 35747502d9e8c6ee217385ad04446c7c2aaf9c5c
241
+  FirebaseDynamicLinks: c713da5f75c324f38fb2d57164bbc1c461aa6739
242
+  FirebaseInstanceID: e2fa4cb35ef5558c200f7f0ad8a53e212215f93e
160 243
   FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31
161 244
   Folly: c89ac2d5c6ab169cd7397ef27485c44f35f742c7
162 245
   glog: e8acf0ebbf99759d3ff18c86c292a5898282dcde
246
+  GoogleAppMeasurement: 98b71f5e04142793729a5ef23e5b96651ff4b70f
163 247
   GoogleSignIn: 7ff245e1a7b26d379099d3243a562f5747e23d39
164 248
   GoogleToolboxForMac: ff31605b7d66400dcec09bed5861689aebadda4d
249
+  GoogleUtilities: 95996bea7c7d9b8fb811b7507669a4a8762f80c7
165 250
   GTMSessionFetcher: 32aeca0aa144acea523e1c8e053089dec2cb98ca
251
+  nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48
166 252
   ObjectiveDropboxOfficial: aa792e0556ceb7b72955fa29a2709072f6e35fd9
167 253
   React: 1fe0eb13d90b625d94c3b117c274dcfd2e760e11
168 254
   react-native-background-timer: bb7a98c8e97fc7c290de2d423dd09ddb73dcbcbb
@@ -176,6 +262,6 @@ SPEC CHECKSUMS:
176 262
   SDWebImage: c5594f1a19c48d526d321e548902b56b479cd508
177 263
   yoga: b1ce48b6cf950b98deae82838f5173ea7cf89e85
178 264
 
179
-PODFILE CHECKSUM: 2fa79bc1fe2fe42efb63895fdb0cb84d5f578884
265
+PODFILE CHECKSUM: b5218184626a027e8b1ca12361d46100e2fa2f1f
180 266
 
181 267
 COCOAPODS: 1.5.3

+ 28
- 0
ios/app/GoogleService-Info.plist Voir le fichier

@@ -0,0 +1,28 @@
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>API_KEY</key>
6
+	<string>correct_api_key</string>
7
+	<key>TRACKING_ID</key>
8
+	<string>correct_tracking_id</string>
9
+	<key>CLIENT_ID</key>
10
+	<string>correct_client_id</string>
11
+	<key>REVERSED_CLIENT_ID</key>
12
+	<string>correct_reversed_client_id</string>
13
+	<key>GOOGLE_APP_ID</key>
14
+	<string>1:123:ios:123abc</string>
15
+	<key>GCM_SENDER_ID</key>
16
+	<string>correct_gcm_sender_id</string>
17
+	<key>PLIST_VERSION</key>
18
+	<string>1</string>
19
+	<key>BUNDLE_ID</key>
20
+	<string>com.google.FirebaseSDKTests</string>
21
+	<key>PROJECT_ID</key>
22
+	<string>abc-xyz-123</string>
23
+	<key>DATABASE_URL</key>
24
+	<string>https://abc-xyz-123.firebaseio.com</string>
25
+	<key>STORAGE_BUCKET</key>
26
+	<string>project-id-123.storage.firebase.com</string>
27
+</dict>
28
+</plist>

+ 72
- 2
ios/app/app.xcodeproj/project.pbxproj Voir le fichier

@@ -17,6 +17,9 @@
17 17
 		13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
18 18
 		13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
19 19
 		13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
20
+		695AF3ED6F686F9C5EE40F9A /* libPods-jitsi-meet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 489E8EFE2C720D10F5961AEF /* libPods-jitsi-meet.a */; };
21
+		DE4C455E21DE1E4300EA0709 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = DE4C455D21DE1E4300EA0709 /* GoogleService-Info.plist */; };
22
+		DE4C456121DE1E4E00EA0709 /* FIRUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = DE4C455F21DE1E4E00EA0709 /* FIRUtilities.m */; };
20 23
 /* End PBXBuildFile section */
21 24
 
22 25
 /* Begin PBXCopyFilesBuildPhase section */
@@ -35,6 +38,7 @@
35 38
 /* End PBXCopyFilesBuildPhase section */
36 39
 
37 40
 /* Begin PBXFileReference section */
41
+		09AA3B93E4CC62D84B424690 /* Pods-jitsi-meet.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-jitsi-meet.release.xcconfig"; path = "../Pods/Target Support Files/Pods-jitsi-meet/Pods-jitsi-meet.release.xcconfig"; sourceTree = "<group>"; };
38 42
 		0B26BE6D1EC5BC3C00EEFB41 /* JitsiMeet.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = JitsiMeet.framework; sourceTree = BUILT_PRODUCTS_DIR; };
39 43
 		0B412F1D1EDEE6E800B1A0A6 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
40 44
 		0B412F1E1EDEE6E800B1A0A6 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
@@ -47,7 +51,12 @@
47 51
 		13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
48 52
 		13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
49 53
 		13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
54
+		4670A512A688E2DC34528282 /* Pods-jitsi-meet.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-jitsi-meet.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-jitsi-meet/Pods-jitsi-meet.debug.xcconfig"; sourceTree = "<group>"; };
55
+		489E8EFE2C720D10F5961AEF /* libPods-jitsi-meet.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-jitsi-meet.a"; sourceTree = BUILT_PRODUCTS_DIR; };
50 56
 		B3B083EB1D4955FF0069CEE7 /* app.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = app.entitlements; sourceTree = "<group>"; };
57
+		DE4C455D21DE1E4300EA0709 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = SOURCE_ROOT; };
58
+		DE4C455F21DE1E4E00EA0709 /* FIRUtilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FIRUtilities.m; sourceTree = "<group>"; };
59
+		DE4C456021DE1E4E00EA0709 /* FIRUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FIRUtilities.h; sourceTree = "<group>"; };
51 60
 /* End PBXFileReference section */
52 61
 
53 62
 /* Begin PBXFrameworksBuildPhase section */
@@ -57,6 +66,7 @@
57 66
 			files = (
58 67
 				0B26BE6E1EC5BC3C00EEFB41 /* JitsiMeet.framework in Frameworks */,
59 68
 				0BD6B4371EF82A6B00D1F4CD /* WebRTC.framework in Frameworks */,
69
+				695AF3ED6F686F9C5EE40F9A /* libPods-jitsi-meet.a in Frameworks */,
60 70
 			);
61 71
 			runOnlyForDeploymentPostprocessing = 0;
62 72
 		};
@@ -68,6 +78,7 @@
68 78
 			children = (
69 79
 				0B26BE6D1EC5BC3C00EEFB41 /* JitsiMeet.framework */,
70 80
 				0BD6B4361EF82A6B00D1F4CD /* WebRTC.framework */,
81
+				489E8EFE2C720D10F5961AEF /* libPods-jitsi-meet.a */,
71 82
 			);
72 83
 			name = Frameworks;
73 84
 			sourceTree = "<group>";
@@ -77,6 +88,9 @@
77 88
 			children = (
78 89
 				13B07FAF1A68108700A75B9A /* AppDelegate.h */,
79 90
 				13B07FB01A68108700A75B9A /* AppDelegate.m */,
91
+				DE4C456021DE1E4E00EA0709 /* FIRUtilities.h */,
92
+				DE4C455F21DE1E4E00EA0709 /* FIRUtilities.m */,
93
+				DE4C455D21DE1E4300EA0709 /* GoogleService-Info.plist */,
80 94
 				13B07FB51A68108700A75B9A /* Images.xcassets */,
81 95
 				13B07FB61A68108700A75B9A /* Info.plist */,
82 96
 				13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
@@ -88,6 +102,15 @@
88 102
 			path = src;
89 103
 			sourceTree = "<group>";
90 104
 		};
105
+		5E96ADD5E49F3B3822EF9A52 /* Pods */ = {
106
+			isa = PBXGroup;
107
+			children = (
108
+				4670A512A688E2DC34528282 /* Pods-jitsi-meet.debug.xcconfig */,
109
+				09AA3B93E4CC62D84B424690 /* Pods-jitsi-meet.release.xcconfig */,
110
+			);
111
+			name = Pods;
112
+			sourceTree = "<group>";
113
+		};
91 114
 		83CBB9F61A601CBA00E9B192 = {
92 115
 			isa = PBXGroup;
93 116
 			children = (
@@ -95,6 +118,7 @@
95 118
 				0B26BE711EC5BC4D00EEFB41 /* Frameworks */,
96 119
 				83CBBA001A601CBA00E9B192 /* Products */,
97 120
 				13B07FAE1A68108700A75B9A /* src */,
121
+				5E96ADD5E49F3B3822EF9A52 /* Pods */,
98 122
 			);
99 123
 			indentWidth = 2;
100 124
 			sourceTree = "<group>";
@@ -115,6 +139,7 @@
115 139
 			isa = PBXNativeTarget;
116 140
 			buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "jitsi-meet" */;
117 141
 			buildPhases = (
142
+				B6607F42A5CF0C76E98929E2 /* [CP] Check Pods Manifest.lock */,
118 143
 				0BBA83C41EC9F7600075A103 /* Run React packager */,
119 144
 				13B07F871A680F5B00A75B9A /* Sources */,
120 145
 				13B07F8C1A680F5B00A75B9A /* Frameworks */,
@@ -122,6 +147,7 @@
122 147
 				0B26BE701EC5BC3C00EEFB41 /* Embed Frameworks */,
123 148
 				B35383AD1DDA0083008F406A /* Adjust embedded framework architectures */,
124 149
 				0BB7DA181EC9E695007AAE98 /* Adjust ATS */,
150
+				DEC2069321CBBD6900072F03 /* Setup Fabric */,
125 151
 			);
126 152
 			buildRules = (
127 153
 			);
@@ -175,6 +201,7 @@
175 201
 			buildActionMask = 2147483647;
176 202
 			files = (
177 203
 				0B412F211EDEE95300B1A0A6 /* Main.storyboard in Resources */,
204
+				DE4C455E21DE1E4300EA0709 /* GoogleService-Info.plist in Resources */,
178 205
 				13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
179 206
 				13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
180 207
 			);
@@ -195,7 +222,7 @@
195 222
 			);
196 223
 			runOnlyForDeploymentPostprocessing = 0;
197 224
 			shellPath = /bin/sh;
198
-			shellScript = "../scripts/fixup-ats.sh";
225
+			shellScript = "../scripts/fixup-ats.sh\n";
199 226
 		};
200 227
 		0BBA83C41EC9F7600075A103 /* Run React packager */ = {
201 228
 			isa = PBXShellScriptBuildPhase;
@@ -223,7 +250,47 @@
223 250
 			);
224 251
 			runOnlyForDeploymentPostprocessing = 0;
225 252
 			shellPath = /bin/sh;
226
-			shellScript = "../scripts/fixup-frameworks.sh";
253
+			shellScript = "../scripts/fixup-frameworks.sh\n";
254
+		};
255
+		B6607F42A5CF0C76E98929E2 /* [CP] Check Pods Manifest.lock */ = {
256
+			isa = PBXShellScriptBuildPhase;
257
+			buildActionMask = 2147483647;
258
+			files = (
259
+			);
260
+			inputFileListPaths = (
261
+			);
262
+			inputPaths = (
263
+				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
264
+				"${PODS_ROOT}/Manifest.lock",
265
+			);
266
+			name = "[CP] Check Pods Manifest.lock";
267
+			outputFileListPaths = (
268
+			);
269
+			outputPaths = (
270
+				"$(DERIVED_FILE_DIR)/Pods-jitsi-meet-checkManifestLockResult.txt",
271
+			);
272
+			runOnlyForDeploymentPostprocessing = 0;
273
+			shellPath = /bin/sh;
274
+			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# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
275
+			showEnvVarsInLog = 0;
276
+		};
277
+		DEC2069321CBBD6900072F03 /* Setup Fabric */ = {
278
+			isa = PBXShellScriptBuildPhase;
279
+			buildActionMask = 2147483647;
280
+			files = (
281
+			);
282
+			inputFileListPaths = (
283
+			);
284
+			inputPaths = (
285
+			);
286
+			name = "Setup Fabric";
287
+			outputFileListPaths = (
288
+			);
289
+			outputPaths = (
290
+			);
291
+			runOnlyForDeploymentPostprocessing = 0;
292
+			shellPath = /bin/sh;
293
+			shellScript = "${PODS_ROOT}/Fabric/run\n";
227 294
 		};
228 295
 /* End PBXShellScriptBuildPhase section */
229 296
 
@@ -234,6 +301,7 @@
234 301
 			files = (
235 302
 				0B412F1F1EDEE6E800B1A0A6 /* ViewController.m in Sources */,
236 303
 				13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
304
+				DE4C456121DE1E4E00EA0709 /* FIRUtilities.m in Sources */,
237 305
 				13B07FC11A68108700A75B9A /* main.m in Sources */,
238 306
 			);
239 307
 			runOnlyForDeploymentPostprocessing = 0;
@@ -254,6 +322,7 @@
254 322
 /* Begin XCBuildConfiguration section */
255 323
 		13B07F941A680F5B00A75B9A /* Debug */ = {
256 324
 			isa = XCBuildConfiguration;
325
+			baseConfigurationReference = 4670A512A688E2DC34528282 /* Pods-jitsi-meet.debug.xcconfig */;
257 326
 			buildSettings = {
258 327
 				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
259 328
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIconDebug;
@@ -287,6 +356,7 @@
287 356
 		};
288 357
 		13B07F951A680F5B00A75B9A /* Release */ = {
289 358
 			isa = XCBuildConfiguration;
359
+			baseConfigurationReference = 09AA3B93E4CC62D84B424690 /* Pods-jitsi-meet.release.xcconfig */;
290 360
 			buildSettings = {
291 361
 				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
292 362
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIconRelease;

+ 58
- 2
ios/app/src/AppDelegate.m Voir le fichier

@@ -1,5 +1,6 @@
1 1
 /*
2
- * Copyright @ 2017-present Atlassian Pty Ltd
2
+ * Copyright @ 2018-present 8x8, Inc.
3
+ * Copyright @ 2017-2018 Atlassian Pty Ltd
3 4
  *
4 5
  * Licensed under the Apache License, Version 2.0 (the "License");
5 6
  * you may not use this file except in compliance with the License.
@@ -15,13 +16,27 @@
15 16
  */
16 17
 
17 18
 #import "AppDelegate.h"
19
+#import "FIRUtilities.h"
18 20
 
19 21
 #import <JitsiMeet/JitsiMeet.h>
20 22
 
23
+@import Crashlytics;
24
+@import Fabric;
25
+@import Firebase;
26
+
27
+
21 28
 @implementation AppDelegate
22 29
 
23 30
 -             (BOOL)application:(UIApplication *)application
24 31
   didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
32
+
33
+    // Initialize Crashlytics and Firebase if a valid GoogleService-Info.plist file was provided.
34
+    if ([FIRUtilities appContainsRealServiceInfoPlist]) {
35
+        NSLog(@"Enablign Crashlytics and Firebase");
36
+        [FIRApp configure];
37
+        [Fabric with:@[[Crashlytics class]]];
38
+    }
39
+
25 40
     return [JitsiMeetView application:application
26 41
         didFinishLaunchingWithOptions:launchOptions];
27 42
 }
@@ -31,6 +46,30 @@
31 46
 -    (BOOL)application:(UIApplication *)application
32 47
   continueUserActivity:(NSUserActivity *)userActivity
33 48
     restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> *restorableObjects))restorationHandler {
49
+
50
+    if ([FIRUtilities appContainsRealServiceInfoPlist]) {
51
+        // 1. Attempt to handle Universal Links through Firebase in order to support
52
+        //    its Dynamic Links (which we utilize for the purposes of deferred deep
53
+        //    linking).
54
+        BOOL handled
55
+          = [[FIRDynamicLinks dynamicLinks]
56
+                handleUniversalLink:userActivity.webpageURL
57
+                         completion:^(FIRDynamicLink * _Nullable dynamicLink, NSError * _Nullable error) {
58
+           NSURL *dynamicLinkURL = dynamicLink.url;
59
+           if (dynamicLinkURL) {
60
+             userActivity.webpageURL = dynamicLinkURL;
61
+             [JitsiMeetView application:application
62
+                   continueUserActivity:userActivity
63
+                     restorationHandler:restorationHandler];
64
+           }
65
+        }];
66
+
67
+        if (handled) {
68
+          return handled;
69
+        }
70
+    }
71
+
72
+    // 2. Default to plain old, non-Firebase-assisted Universal Links.
34 73
     return [JitsiMeetView application:application
35 74
                  continueUserActivity:userActivity
36 75
                    restorationHandler:restorationHandler];
@@ -39,8 +78,25 @@
39 78
 - (BOOL)application:(UIApplication *)app
40 79
             openURL:(NSURL *)url
41 80
             options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
81
+
82
+    NSURL *openUrl = url;
83
+
84
+    if ([FIRUtilities appContainsRealServiceInfoPlist]) {
85
+        // Process Firebase Dynamic Links
86
+        FIRDynamicLink *dynamicLink = [[FIRDynamicLinks dynamicLinks] dynamicLinkFromCustomSchemeURL:url];
87
+        if (dynamicLink != nil) {
88
+            NSURL *dynamicLinkURL = dynamicLink.url;
89
+            if (dynamicLinkURL != nil
90
+                    && (dynamicLink.matchType == FIRDLMatchTypeUnique
91
+                        || dynamicLink.matchType == FIRDLMatchTypeDefault)) {
92
+                // Strong match, process it.
93
+                openUrl = dynamicLinkURL;
94
+            }
95
+        }
96
+    }
97
+
42 98
     return [JitsiMeetView application:app
43
-                              openURL:url
99
+                              openURL:openUrl
44 100
                               options:options];
45 101
 }
46 102
 

+ 23
- 0
ios/app/src/FIRUtilities.h Voir le fichier

@@ -0,0 +1,23 @@
1
+/*
2
+ * Copyright 2017 Google
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
+@interface FIRUtilities : NSObject
20
+
21
++ (BOOL)appContainsRealServiceInfoPlist;
22
+
23
+@end

+ 69
- 0
ios/app/src/FIRUtilities.m Voir le fichier

@@ -0,0 +1,69 @@
1
+/*
2
+ * Copyright 2017 Google
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 "FIRUtilities.h"
18
+
19
+// Plist file name.
20
+NSString *const kGoogleServiceInfoFileName = @"GoogleService-Info";
21
+// Plist file type.
22
+NSString *const kGoogleServiceInfoFileType = @"plist";
23
+NSString *const kGoogleAppIDPlistKey = @"GOOGLE_APP_ID";
24
+// Dummy plist GOOGLE_APP_ID
25
+NSString *const kDummyGoogleAppID = @"1:123:ios:123abc";
26
+
27
+
28
+@implementation FIRUtilities
29
+
30
++ (BOOL)appContainsRealServiceInfoPlist {
31
+  static BOOL containsRealServiceInfoPlist = NO;
32
+  static dispatch_once_t onceToken;
33
+  dispatch_once(&onceToken, ^{
34
+    NSBundle *bundle = [NSBundle mainBundle];
35
+    containsRealServiceInfoPlist = [self containsRealServiceInfoPlistInBundle:bundle];
36
+  });
37
+  return containsRealServiceInfoPlist;
38
+}
39
+
40
++ (BOOL)containsRealServiceInfoPlistInBundle:(NSBundle *)bundle {
41
+  NSString *bundlePath = bundle.bundlePath;
42
+  if (!bundlePath.length) {
43
+    return NO;
44
+  }
45
+
46
+  NSString *plistFilePath = [bundle pathForResource:kGoogleServiceInfoFileName
47
+                                             ofType:kGoogleServiceInfoFileType];
48
+  if (!plistFilePath.length) {
49
+    return NO;
50
+  }
51
+
52
+  NSDictionary *plist = [NSDictionary dictionaryWithContentsOfFile:plistFilePath];
53
+  if (!plist) {
54
+    return NO;
55
+  }
56
+
57
+  // Perform a very naive validation by checking to see if the plist has the dummy google app id
58
+  NSString *googleAppID = plist[kGoogleAppIDPlistKey];
59
+  if (!googleAppID.length) {
60
+    return NO;
61
+  }
62
+  if ([googleAppID isEqualToString:kDummyGoogleAppID]) {
63
+    return NO;
64
+  }
65
+
66
+  return YES;
67
+}
68
+
69
+@end

+ 4
- 0
ios/app/src/Info.plist Voir le fichier

@@ -93,5 +93,9 @@
93 93
 	</array>
94 94
 	<key>UIViewControllerBasedStatusBarAppearance</key>
95 95
 	<false/>
96
+	<key>FirebaseScreenReportingEnabled</key>
97
+	<false/>
98
+	<key>firebase_crashlytics_collection_enabled</key>
99
+	<string>false</string>
96 100
 </dict>
97 101
 </plist>

Chargement…
Annuler
Enregistrer