Browse 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é 7 years ago
parent
commit
148d4ebb90

+ 24
- 2
android/app/build.gradle View File

1
 apply plugin: 'com.android.application'
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
 android {
12
 android {
4
     compileSdkVersion rootProject.ext.compileSdkVersion
13
     compileSdkVersion rootProject.ext.compileSdkVersion
5
     buildToolsVersion rootProject.ext.buildToolsVersion
14
     buildToolsVersion rootProject.ext.buildToolsVersion
31
         debug {
40
         debug {
32
             minifyEnabled true
41
             minifyEnabled true
33
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules-debug.pro'
42
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules-debug.pro'
43
+            buildConfigField "boolean", "GOOGLE_SERVICES_ENABLED", "${googleServicesEnabled}"
34
         }
44
         }
35
         release {
45
         release {
36
             minifyEnabled true
46
             minifyEnabled true
37
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules-release.pro'
47
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules-release.pro'
48
+            buildConfigField "boolean", "GOOGLE_SERVICES_ENABLED", "${googleServicesEnabled}"
38
         }
49
         }
39
     }
50
     }
40
 
51
 
44
     }
55
     }
45
 }
56
 }
46
 
57
 
58
+repositories {
59
+    maven { url 'https://maven.fabric.io/public' }
60
+}
61
+
47
 dependencies {
62
 dependencies {
48
     implementation fileTree(dir: 'libs', include: ['*.jar'])
63
     implementation fileTree(dir: 'libs', include: ['*.jar'])
49
     implementation "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"
64
     implementation "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"
50
     implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
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
     implementation project(':sdk')
68
     implementation project(':sdk')
54
 
69
 
63
         exclude group: "com.android.support", module: "annotations"
78
         exclude group: "com.android.support", module: "annotations"
64
     }
79
     }
65
     annotationProcessor "com.github.bumptech.glide:compiler:${rootProject.ext.glideVersion}"
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
 gradle.projectsEvaluated {
90
 gradle.projectsEvaluated {
117
     }
139
     }
118
 }
140
 }
119
 
141
 
120
-if (project.file('google-services.json').exists()) {
142
+if (googleServicesEnabled) {
121
    apply plugin: 'com.google.gms.google-services'
143
    apply plugin: 'com.google.gms.google-services'
122
 }
144
 }

+ 1
- 0
android/app/src/main/AndroidManifest.xml View File

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

+ 30
- 1
android/app/src/main/java/org/jitsi/meet/MainActivity.java View File

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
  * Licensed under the Apache License, Version 2.0 (the "License");
5
  * 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 not use this file except in compliance with the License.
16
 
17
 
17
 package org.jitsi.meet;
18
 package org.jitsi.meet;
18
 
19
 
20
+import android.net.Uri;
19
 import android.os.Bundle;
21
 import android.os.Bundle;
20
 import android.util.Log;
22
 import android.util.Log;
21
 
23
 
27
 import org.jitsi.meet.sdk.invite.InviteController;
29
 import org.jitsi.meet.sdk.invite.InviteController;
28
 import org.jitsi.meet.sdk.invite.InviteControllerListener;
30
 import org.jitsi.meet.sdk.invite.InviteControllerListener;
29
 
31
 
32
+import com.crashlytics.android.Crashlytics;
30
 import com.facebook.react.bridge.UiThreadUtil;
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
 import java.util.ArrayList;
39
 import java.util.ArrayList;
33
 import java.util.List;
40
 import java.util.List;
34
 import java.util.Map;
41
 import java.util.Map;
182
         setWelcomePageEnabled(true);
189
         setWelcomePageEnabled(true);
183
 
190
 
184
         super.onCreate(savedInstanceState);
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
     private void onInviteControllerBeginAddPeople(
216
     private void onInviteControllerBeginAddPeople(

+ 5
- 1
android/build.gradle View File

7
     repositories {
7
     repositories {
8
         google()
8
         google()
9
         jcenter()
9
         jcenter()
10
+        repositories {
11
+            maven { url 'https://maven.fabric.io/public' }
12
+        }
10
     }
13
     }
11
     dependencies {
14
     dependencies {
12
         classpath 'com.android.tools.build:gradle:3.2.1'
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
         // NOTE: Do not place your application dependencies here; they belong
19
         // NOTE: Do not place your application dependencies here; they belong
16
         // in the individual module build.gradle files.
20
         // in the individual module build.gradle files.

+ 9
- 0
ios/Podfile View File

2
 
2
 
3
 workspace 'jitsi-meet'
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
 target 'JitsiMeet' do
14
 target 'JitsiMeet' do
6
   project 'sdk/sdk.xcodeproj'
15
   project 'sdk/sdk.xcodeproj'
7
 
16
 

+ 87
- 1
ios/Podfile.lock View File

1
 PODS:
1
 PODS:
2
   - boost-for-react-native (1.63.0)
2
   - boost-for-react-native (1.63.0)
3
+  - Crashlytics (3.12.0):
4
+    - Fabric (~> 1.9.0)
3
   - DoubleConversion (1.1.6)
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
   - FLAnimatedImage (1.0.12)
35
   - FLAnimatedImage (1.0.12)
5
   - Folly (2016.10.31.00):
36
   - Folly (2016.10.31.00):
6
     - boost-for-react-native
37
     - boost-for-react-native
7
     - DoubleConversion
38
     - DoubleConversion
8
     - glog
39
     - glog
9
   - glog (0.3.5)
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
   - GoogleSignIn (4.4.0):
47
   - GoogleSignIn (4.4.0):
11
     - "GoogleToolboxForMac/NSDictionary+URLArguments (~> 2.1)"
48
     - "GoogleToolboxForMac/NSDictionary+URLArguments (~> 2.1)"
12
     - "GoogleToolboxForMac/NSString+URLArguments (~> 2.1)"
49
     - "GoogleToolboxForMac/NSString+URLArguments (~> 2.1)"
19
     - GoogleToolboxForMac/Defines (= 2.2.0)
56
     - GoogleToolboxForMac/Defines (= 2.2.0)
20
     - "GoogleToolboxForMac/NSString+URLArguments (= 2.2.0)"
57
     - "GoogleToolboxForMac/NSString+URLArguments (= 2.2.0)"
21
   - "GoogleToolboxForMac/NSString+URLArguments (2.2.0)"
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
   - GTMSessionFetcher/Core (1.2.1)
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
   - ObjectiveDropboxOfficial (3.9.2)
83
   - ObjectiveDropboxOfficial (3.9.2)
24
   - React (0.57.8):
84
   - React (0.57.8):
25
     - React/Core (= 0.57.8)
85
     - React/Core (= 0.57.8)
92
   - yoga (0.57.8.React)
152
   - yoga (0.57.8.React)
93
 
153
 
94
 DEPENDENCIES:
154
 DEPENDENCIES:
155
+  - Crashlytics
95
   - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
156
   - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
157
+  - Fabric
158
+  - Firebase/Core
159
+  - Firebase/DynamicLinks
96
   - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
160
   - Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
97
   - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
161
   - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
98
   - ObjectiveDropboxOfficial
162
   - ObjectiveDropboxOfficial
119
 SPEC REPOS:
183
 SPEC REPOS:
120
   https://github.com/cocoapods/specs.git:
184
   https://github.com/cocoapods/specs.git:
121
     - boost-for-react-native
185
     - boost-for-react-native
186
+    - Crashlytics
187
+    - Fabric
188
+    - Firebase
189
+    - FirebaseAnalytics
190
+    - FirebaseAnalyticsInterop
191
+    - FirebaseCore
192
+    - FirebaseDynamicLinks
193
+    - FirebaseInstanceID
122
     - FLAnimatedImage
194
     - FLAnimatedImage
195
+    - GoogleAppMeasurement
123
     - GoogleSignIn
196
     - GoogleSignIn
124
     - GoogleToolboxForMac
197
     - GoogleToolboxForMac
198
+    - GoogleUtilities
125
     - GTMSessionFetcher
199
     - GTMSessionFetcher
200
+    - nanopb
126
     - ObjectiveDropboxOfficial
201
     - ObjectiveDropboxOfficial
127
     - SDWebImage
202
     - SDWebImage
128
 
203
 
156
 
231
 
157
 SPEC CHECKSUMS:
232
 SPEC CHECKSUMS:
158
   boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
233
   boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
234
+  Crashlytics: 07fb167b1694128c1c9a5a5cc319b0e9c3ca0933
159
   DoubleConversion: bb338842f62ab1d708ceb63ec3d999f0f3d98ecd
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
   FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31
243
   FLAnimatedImage: 4a0b56255d9b05f18b6dd7ee06871be5d3b89e31
161
   Folly: c89ac2d5c6ab169cd7397ef27485c44f35f742c7
244
   Folly: c89ac2d5c6ab169cd7397ef27485c44f35f742c7
162
   glog: e8acf0ebbf99759d3ff18c86c292a5898282dcde
245
   glog: e8acf0ebbf99759d3ff18c86c292a5898282dcde
246
+  GoogleAppMeasurement: 98b71f5e04142793729a5ef23e5b96651ff4b70f
163
   GoogleSignIn: 7ff245e1a7b26d379099d3243a562f5747e23d39
247
   GoogleSignIn: 7ff245e1a7b26d379099d3243a562f5747e23d39
164
   GoogleToolboxForMac: ff31605b7d66400dcec09bed5861689aebadda4d
248
   GoogleToolboxForMac: ff31605b7d66400dcec09bed5861689aebadda4d
249
+  GoogleUtilities: 95996bea7c7d9b8fb811b7507669a4a8762f80c7
165
   GTMSessionFetcher: 32aeca0aa144acea523e1c8e053089dec2cb98ca
250
   GTMSessionFetcher: 32aeca0aa144acea523e1c8e053089dec2cb98ca
251
+  nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48
166
   ObjectiveDropboxOfficial: aa792e0556ceb7b72955fa29a2709072f6e35fd9
252
   ObjectiveDropboxOfficial: aa792e0556ceb7b72955fa29a2709072f6e35fd9
167
   React: 1fe0eb13d90b625d94c3b117c274dcfd2e760e11
253
   React: 1fe0eb13d90b625d94c3b117c274dcfd2e760e11
168
   react-native-background-timer: bb7a98c8e97fc7c290de2d423dd09ddb73dcbcbb
254
   react-native-background-timer: bb7a98c8e97fc7c290de2d423dd09ddb73dcbcbb
176
   SDWebImage: c5594f1a19c48d526d321e548902b56b479cd508
262
   SDWebImage: c5594f1a19c48d526d321e548902b56b479cd508
177
   yoga: b1ce48b6cf950b98deae82838f5173ea7cf89e85
263
   yoga: b1ce48b6cf950b98deae82838f5173ea7cf89e85
178
 
264
 
179
-PODFILE CHECKSUM: 2fa79bc1fe2fe42efb63895fdb0cb84d5f578884
265
+PODFILE CHECKSUM: b5218184626a027e8b1ca12361d46100e2fa2f1f
180
 
266
 
181
 COCOAPODS: 1.5.3
267
 COCOAPODS: 1.5.3

+ 28
- 0
ios/app/GoogleService-Info.plist View File

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 View File

17
 		13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
17
 		13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
18
 		13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
18
 		13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
19
 		13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
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
 /* End PBXBuildFile section */
23
 /* End PBXBuildFile section */
21
 
24
 
22
 /* Begin PBXCopyFilesBuildPhase section */
25
 /* Begin PBXCopyFilesBuildPhase section */
35
 /* End PBXCopyFilesBuildPhase section */
38
 /* End PBXCopyFilesBuildPhase section */
36
 
39
 
37
 /* Begin PBXFileReference section */
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
 		0B26BE6D1EC5BC3C00EEFB41 /* JitsiMeet.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = JitsiMeet.framework; sourceTree = BUILT_PRODUCTS_DIR; };
42
 		0B26BE6D1EC5BC3C00EEFB41 /* JitsiMeet.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = JitsiMeet.framework; sourceTree = BUILT_PRODUCTS_DIR; };
39
 		0B412F1D1EDEE6E800B1A0A6 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
43
 		0B412F1D1EDEE6E800B1A0A6 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
40
 		0B412F1E1EDEE6E800B1A0A6 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
44
 		0B412F1E1EDEE6E800B1A0A6 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
47
 		13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
51
 		13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
48
 		13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
52
 		13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
49
 		13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
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
 		B3B083EB1D4955FF0069CEE7 /* app.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = app.entitlements; sourceTree = "<group>"; };
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
 /* End PBXFileReference section */
60
 /* End PBXFileReference section */
52
 
61
 
53
 /* Begin PBXFrameworksBuildPhase section */
62
 /* Begin PBXFrameworksBuildPhase section */
57
 			files = (
66
 			files = (
58
 				0B26BE6E1EC5BC3C00EEFB41 /* JitsiMeet.framework in Frameworks */,
67
 				0B26BE6E1EC5BC3C00EEFB41 /* JitsiMeet.framework in Frameworks */,
59
 				0BD6B4371EF82A6B00D1F4CD /* WebRTC.framework in Frameworks */,
68
 				0BD6B4371EF82A6B00D1F4CD /* WebRTC.framework in Frameworks */,
69
+				695AF3ED6F686F9C5EE40F9A /* libPods-jitsi-meet.a in Frameworks */,
60
 			);
70
 			);
61
 			runOnlyForDeploymentPostprocessing = 0;
71
 			runOnlyForDeploymentPostprocessing = 0;
62
 		};
72
 		};
68
 			children = (
78
 			children = (
69
 				0B26BE6D1EC5BC3C00EEFB41 /* JitsiMeet.framework */,
79
 				0B26BE6D1EC5BC3C00EEFB41 /* JitsiMeet.framework */,
70
 				0BD6B4361EF82A6B00D1F4CD /* WebRTC.framework */,
80
 				0BD6B4361EF82A6B00D1F4CD /* WebRTC.framework */,
81
+				489E8EFE2C720D10F5961AEF /* libPods-jitsi-meet.a */,
71
 			);
82
 			);
72
 			name = Frameworks;
83
 			name = Frameworks;
73
 			sourceTree = "<group>";
84
 			sourceTree = "<group>";
77
 			children = (
88
 			children = (
78
 				13B07FAF1A68108700A75B9A /* AppDelegate.h */,
89
 				13B07FAF1A68108700A75B9A /* AppDelegate.h */,
79
 				13B07FB01A68108700A75B9A /* AppDelegate.m */,
90
 				13B07FB01A68108700A75B9A /* AppDelegate.m */,
91
+				DE4C456021DE1E4E00EA0709 /* FIRUtilities.h */,
92
+				DE4C455F21DE1E4E00EA0709 /* FIRUtilities.m */,
93
+				DE4C455D21DE1E4300EA0709 /* GoogleService-Info.plist */,
80
 				13B07FB51A68108700A75B9A /* Images.xcassets */,
94
 				13B07FB51A68108700A75B9A /* Images.xcassets */,
81
 				13B07FB61A68108700A75B9A /* Info.plist */,
95
 				13B07FB61A68108700A75B9A /* Info.plist */,
82
 				13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
96
 				13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
88
 			path = src;
102
 			path = src;
89
 			sourceTree = "<group>";
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
 		83CBB9F61A601CBA00E9B192 = {
114
 		83CBB9F61A601CBA00E9B192 = {
92
 			isa = PBXGroup;
115
 			isa = PBXGroup;
93
 			children = (
116
 			children = (
95
 				0B26BE711EC5BC4D00EEFB41 /* Frameworks */,
118
 				0B26BE711EC5BC4D00EEFB41 /* Frameworks */,
96
 				83CBBA001A601CBA00E9B192 /* Products */,
119
 				83CBBA001A601CBA00E9B192 /* Products */,
97
 				13B07FAE1A68108700A75B9A /* src */,
120
 				13B07FAE1A68108700A75B9A /* src */,
121
+				5E96ADD5E49F3B3822EF9A52 /* Pods */,
98
 			);
122
 			);
99
 			indentWidth = 2;
123
 			indentWidth = 2;
100
 			sourceTree = "<group>";
124
 			sourceTree = "<group>";
115
 			isa = PBXNativeTarget;
139
 			isa = PBXNativeTarget;
116
 			buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "jitsi-meet" */;
140
 			buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "jitsi-meet" */;
117
 			buildPhases = (
141
 			buildPhases = (
142
+				B6607F42A5CF0C76E98929E2 /* [CP] Check Pods Manifest.lock */,
118
 				0BBA83C41EC9F7600075A103 /* Run React packager */,
143
 				0BBA83C41EC9F7600075A103 /* Run React packager */,
119
 				13B07F871A680F5B00A75B9A /* Sources */,
144
 				13B07F871A680F5B00A75B9A /* Sources */,
120
 				13B07F8C1A680F5B00A75B9A /* Frameworks */,
145
 				13B07F8C1A680F5B00A75B9A /* Frameworks */,
122
 				0B26BE701EC5BC3C00EEFB41 /* Embed Frameworks */,
147
 				0B26BE701EC5BC3C00EEFB41 /* Embed Frameworks */,
123
 				B35383AD1DDA0083008F406A /* Adjust embedded framework architectures */,
148
 				B35383AD1DDA0083008F406A /* Adjust embedded framework architectures */,
124
 				0BB7DA181EC9E695007AAE98 /* Adjust ATS */,
149
 				0BB7DA181EC9E695007AAE98 /* Adjust ATS */,
150
+				DEC2069321CBBD6900072F03 /* Setup Fabric */,
125
 			);
151
 			);
126
 			buildRules = (
152
 			buildRules = (
127
 			);
153
 			);
175
 			buildActionMask = 2147483647;
201
 			buildActionMask = 2147483647;
176
 			files = (
202
 			files = (
177
 				0B412F211EDEE95300B1A0A6 /* Main.storyboard in Resources */,
203
 				0B412F211EDEE95300B1A0A6 /* Main.storyboard in Resources */,
204
+				DE4C455E21DE1E4300EA0709 /* GoogleService-Info.plist in Resources */,
178
 				13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
205
 				13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
179
 				13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
206
 				13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
180
 			);
207
 			);
195
 			);
222
 			);
196
 			runOnlyForDeploymentPostprocessing = 0;
223
 			runOnlyForDeploymentPostprocessing = 0;
197
 			shellPath = /bin/sh;
224
 			shellPath = /bin/sh;
198
-			shellScript = "../scripts/fixup-ats.sh";
225
+			shellScript = "../scripts/fixup-ats.sh\n";
199
 		};
226
 		};
200
 		0BBA83C41EC9F7600075A103 /* Run React packager */ = {
227
 		0BBA83C41EC9F7600075A103 /* Run React packager */ = {
201
 			isa = PBXShellScriptBuildPhase;
228
 			isa = PBXShellScriptBuildPhase;
223
 			);
250
 			);
224
 			runOnlyForDeploymentPostprocessing = 0;
251
 			runOnlyForDeploymentPostprocessing = 0;
225
 			shellPath = /bin/sh;
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
 /* End PBXShellScriptBuildPhase section */
295
 /* End PBXShellScriptBuildPhase section */
229
 
296
 
234
 			files = (
301
 			files = (
235
 				0B412F1F1EDEE6E800B1A0A6 /* ViewController.m in Sources */,
302
 				0B412F1F1EDEE6E800B1A0A6 /* ViewController.m in Sources */,
236
 				13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
303
 				13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
304
+				DE4C456121DE1E4E00EA0709 /* FIRUtilities.m in Sources */,
237
 				13B07FC11A68108700A75B9A /* main.m in Sources */,
305
 				13B07FC11A68108700A75B9A /* main.m in Sources */,
238
 			);
306
 			);
239
 			runOnlyForDeploymentPostprocessing = 0;
307
 			runOnlyForDeploymentPostprocessing = 0;
254
 /* Begin XCBuildConfiguration section */
322
 /* Begin XCBuildConfiguration section */
255
 		13B07F941A680F5B00A75B9A /* Debug */ = {
323
 		13B07F941A680F5B00A75B9A /* Debug */ = {
256
 			isa = XCBuildConfiguration;
324
 			isa = XCBuildConfiguration;
325
+			baseConfigurationReference = 4670A512A688E2DC34528282 /* Pods-jitsi-meet.debug.xcconfig */;
257
 			buildSettings = {
326
 			buildSettings = {
258
 				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
327
 				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
259
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIconDebug;
328
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIconDebug;
287
 		};
356
 		};
288
 		13B07F951A680F5B00A75B9A /* Release */ = {
357
 		13B07F951A680F5B00A75B9A /* Release */ = {
289
 			isa = XCBuildConfiguration;
358
 			isa = XCBuildConfiguration;
359
+			baseConfigurationReference = 09AA3B93E4CC62D84B424690 /* Pods-jitsi-meet.release.xcconfig */;
290
 			buildSettings = {
360
 			buildSettings = {
291
 				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
361
 				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
292
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIconRelease;
362
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIconRelease;

+ 58
- 2
ios/app/src/AppDelegate.m View File

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
  * Licensed under the Apache License, Version 2.0 (the "License");
5
  * 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 not use this file except in compliance with the License.
15
  */
16
  */
16
 
17
 
17
 #import "AppDelegate.h"
18
 #import "AppDelegate.h"
19
+#import "FIRUtilities.h"
18
 
20
 
19
 #import <JitsiMeet/JitsiMeet.h>
21
 #import <JitsiMeet/JitsiMeet.h>
20
 
22
 
23
+@import Crashlytics;
24
+@import Fabric;
25
+@import Firebase;
26
+
27
+
21
 @implementation AppDelegate
28
 @implementation AppDelegate
22
 
29
 
23
 -             (BOOL)application:(UIApplication *)application
30
 -             (BOOL)application:(UIApplication *)application
24
   didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
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
     return [JitsiMeetView application:application
40
     return [JitsiMeetView application:application
26
         didFinishLaunchingWithOptions:launchOptions];
41
         didFinishLaunchingWithOptions:launchOptions];
27
 }
42
 }
31
 -    (BOOL)application:(UIApplication *)application
46
 -    (BOOL)application:(UIApplication *)application
32
   continueUserActivity:(NSUserActivity *)userActivity
47
   continueUserActivity:(NSUserActivity *)userActivity
33
     restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> *restorableObjects))restorationHandler {
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
     return [JitsiMeetView application:application
73
     return [JitsiMeetView application:application
35
                  continueUserActivity:userActivity
74
                  continueUserActivity:userActivity
36
                    restorationHandler:restorationHandler];
75
                    restorationHandler:restorationHandler];
39
 - (BOOL)application:(UIApplication *)app
78
 - (BOOL)application:(UIApplication *)app
40
             openURL:(NSURL *)url
79
             openURL:(NSURL *)url
41
             options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
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
     return [JitsiMeetView application:app
98
     return [JitsiMeetView application:app
43
-                              openURL:url
99
+                              openURL:openUrl
44
                               options:options];
100
                               options:options];
45
 }
101
 }
46
 
102
 

+ 23
- 0
ios/app/src/FIRUtilities.h View File

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 View File

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 View File

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

Loading…
Cancel
Save