Skip to content

Commit

Permalink
Integrating Firebase Crashlytics lib
Browse files Browse the repository at this point in the history
  • Loading branch information
rpanadero committed May 5, 2020
1 parent f9f81da commit fab28b3
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 3 deletions.
1 change: 1 addition & 0 deletions CapacitorFirebase.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
s.dependency 'Firebase/Messaging', '6.23.0'
s.dependency 'Firebase/Analytics', '6.23.0'
s.dependency 'Firebase/DynamicLinks', '6.23.0'
s.dependency 'Firebase/Crashlytics', '6.23.0'
s.static_framework = true
end
78 changes: 76 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ After any change it is needed to generate all distribution files again and push
$ npm run build
```

## Configure Firebase Dynamic Deeplinks
## Configure Firebase Dynamic Deeplinks

### Android
### Android
- As with plain deep links, you must add a new intent filter to the activity that handles deep links for your app. The intent filter should catch deep links of your domain, since the Dynamic Link will redirect to your domain if your app is installed. This is required for your app to receive the Dynamic Link data after it is installed/updated from the Play Store and one taps on Continue button. In AndroidManifest.xml:
```
<!-- Dynamic links config -->
Expand Down Expand Up @@ -49,3 +49,77 @@ func application(_ app: UIApplication, open url: URL, options: [UIApplication.Op
}
```

## Configure Crashlytics

### Android
1 - In your project-level build.gradle file, add the Crashlytics Gradle plugin:

```
buildscript {
repositories {
// Check that you have Google's Maven repository (if not, add it).
google()
}
dependencies {
// ...
// Check that you have the Google Services Gradle plugin v4.3.2 or later
// (if not, add it).
classpath 'com.google.gms:google-services:4.3.3'
// Add the Crashlytics Gradle plugin.
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0'
}
}
allprojects {
repositories {
// Check that you have Google's Maven repository (if not, add it).
google()
}
}
```
2 - In your app-level build.gradle file, apply the Crashlytics Gradle plugin:

```
// Apply the Crashlytics Gradle plugin
apply plugin: 'com.google.firebase.crashlytics'
```

## iOS

Configure compilation with dSYM files

1 - Select its project file in the left navigator.

2 - Select the Build Settings tab

3 - Set "Debug Information Format" to "dWARF with dSYM File" for Debug and Release.

Configure Run script

1 - Select its project file in the left navigator.

2 - From the Select a project or target dropdown, select your main build target.

3 - Select the Build Phases tab, then click add > New Run Script Phase.

4 - Expand the new Run Script section that appears. In the script field (located under the Shell field), add a new run script:

```
"${PODS_ROOT}/FirebaseCrashlytics/run"
```

5 - Add your app’s dSYM location as an input file that enables Crashlytics to automatically generate dSYMs for large apps more quickly. For example:

```
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}
```

You can also provide your app's built Info.plist location to the build phase's Input Files field:

```
${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}
```
2 changes: 2 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ext {
firebaseConfigVersion = project.hasProperty('firebaseConfigVersion') ? rootProject.ext.firebaseConfigVersion : '19.1.4'
firebaseDynamicLinksVersion = project.hasProperty('firebaseDynamicLinksVersion') ? rootProject.ext.firebaseDynamicLinksVersion : '19.1.0'
firebaseAnalyticsVersion = project.hasProperty('firebaseAnalyticsVersion') ? rootProject.ext.firebaseAnalyticsVersion : '17.4.0'
firebaseCrashlyticsVersion = project.hasProperty('firebaseCrashlyticsVersion') ? rootProject.ext.firebaseCrashlyticsVersion : '17.0.0'
}

buildscript {
Expand Down Expand Up @@ -55,6 +56,7 @@ dependencies {
implementation "com.google.firebase:firebase-config:$firebaseConfigVersion"
implementation "com.google.firebase:firebase-dynamic-links:$firebaseDynamicLinksVersion"
implementation "com.google.firebase:firebase-analytics:$firebaseAnalyticsVersion"
implementation "com.google.firebase:firebase-crashlytics:$firebaseCrashlyticsVersion"
testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
Expand Down
1 change: 1 addition & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def capacitor_pods
pod 'Firebase/Messaging', '6.23.0'
pod 'Firebase/Analytics', '6.23.0'
pod 'Firebase/DynamicLinks', '6.23.0'
pod 'Firebase/Crashlytics', '6.23.0'
end

target 'Plugin' do
Expand Down
16 changes: 15 additions & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ PODS:
- FirebaseAnalytics (= 6.4.2)
- Firebase/CoreOnly (6.23.0):
- FirebaseCore (= 6.6.7)
- Firebase/Crashlytics (6.23.0):
- Firebase/CoreOnly
- FirebaseCrashlytics (~> 4.0.0)
- Firebase/DynamicLinks (6.23.0):
- Firebase/CoreOnly
- FirebaseDynamicLinks (~> 4.0.8)
Expand Down Expand Up @@ -44,6 +47,14 @@ PODS:
- GoogleUtilities/Logger (~> 6.5)
- nanopb (~> 0.3.901)
- FirebaseCoreDiagnosticsInterop (1.2.0)
- FirebaseCrashlytics (4.0.0):
- FirebaseAnalyticsInterop (~> 1.2)
- FirebaseCore (~> 6.6)
- FirebaseInstallations (~> 1.1)
- GoogleDataTransport (~> 6.0)
- GoogleDataTransportCCTSupport (~> 3.0)
- nanopb (~> 0.3.901)
- PromisesObjC (~> 1.2)
- FirebaseDynamicLinks (4.0.8):
- FirebaseAnalyticsInterop (~> 1.3)
- FirebaseCore (~> 6.2)
Expand Down Expand Up @@ -115,6 +126,7 @@ DEPENDENCIES:
- "Capacitor (from `../node_modules/@capacitor/ios`)"
- "CapacitorCordova (from `../node_modules/@capacitor/ios`)"
- Firebase/Analytics (= 6.23.0)
- Firebase/Crashlytics (= 6.23.0)
- Firebase/DynamicLinks (= 6.23.0)
- Firebase/Messaging (= 6.23.0)
- Firebase/RemoteConfig (= 6.23.0)
Expand All @@ -128,6 +140,7 @@ SPEC REPOS:
- FirebaseCore
- FirebaseCoreDiagnostics
- FirebaseCoreDiagnosticsInterop
- FirebaseCrashlytics
- FirebaseDynamicLinks
- FirebaseInstallations
- FirebaseInstanceID
Expand Down Expand Up @@ -157,6 +170,7 @@ SPEC CHECKSUMS:
FirebaseCore: a2788a0d5f6c1dff17b8f79b4a73654a8d4bfdbd
FirebaseCoreDiagnostics: b59c024493a409f8aecba02c99928d0d8431d159
FirebaseCoreDiagnosticsInterop: 296e2c5f5314500a850ad0b83e9e7c10b011a850
FirebaseCrashlytics: 941608d2a3475b48fb7010b998703d07696b8db1
FirebaseDynamicLinks: 417dc6dbb6013233c77558290d73296f429656a6
FirebaseInstallations: 2119fb3e46b0a88bfdbf12562f855ee3252462fa
FirebaseInstanceID: cef67c4967c7cecb56ea65d8acbb4834825c587b
Expand All @@ -170,6 +184,6 @@ SPEC CHECKSUMS:
PromisesObjC: c119f3cd559f50b7ae681fa59dc1acd19173b7e6
Protobuf: 176220c526ad8bd09ab1fb40a978eac3fef665f7

PODFILE CHECKSUM: 9e9198cea020d0d73df82a68392a85d9568c9a4f
PODFILE CHECKSUM: 9af9f8b6ad1b5d40bd39f1f6a8d008492208098e

COCOAPODS: 1.7.3

0 comments on commit fab28b3

Please sign in to comment.