Skip to content

Commit

Permalink
fix: crashlytics native plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismclarke committed Jun 27, 2024
1 parent 37e9df7 commit 00a33f1
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies {
implementation project(':capacitor-blob-writer')
implementation project(':capacitor-video-player')
implementation project(':capacitor-community-firebase-analytics')
implementation project(':capacitor-community-firebase-crashlytics')
implementation project(':capacitor-firebase-crashlytics')
implementation project(':capacitor-firebase-performance')
implementation project(':capacitor-screen-orientation')
implementation project(':capacitor-camera')
Expand Down
2 changes: 1 addition & 1 deletion apps/picsa-apps/extension-app-native/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.5.0'
classpath 'com.android.tools.build:gradle:8.1.4'
classpath 'com.google.gms:google-services:4.4.0'

// NOTE: Do not place your application dependencies here; they belong
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ project(':capacitor-video-player').projectDir = new File('../../../../node_modul
include ':capacitor-community-firebase-analytics'
project(':capacitor-community-firebase-analytics').projectDir = new File('../../../../node_modules/@capacitor-community/firebase-analytics/android')

include ':capacitor-community-firebase-crashlytics'
project(':capacitor-community-firebase-crashlytics').projectDir = new File('../../../../node_modules/@capacitor-community/firebase-crashlytics/android')
include ':capacitor-firebase-crashlytics'
project(':capacitor-firebase-crashlytics').projectDir = new File('../../../../node_modules/@capacitor-firebase/crashlytics/android')

include ':capacitor-firebase-performance'
project(':capacitor-firebase-performance').projectDir = new File('../../../../node_modules/@capacitor-firebase/performance/android')
Expand All @@ -37,5 +37,6 @@ project(':capacitor-screen-orientation').projectDir = new File('../../../../node

include ':capacitor-camera'
project(':capacitor-camera').projectDir = new File('../../../../node_modules/@capacitor/camera/android')

include ':capacitor-share'
project(':capacitor-share').projectDir = new File('../../../../node_modules/@capacitor/share/android')
2 changes: 1 addition & 1 deletion apps/picsa-apps/extension-app-native/capacitor.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const config: CapacitorConfig = {
'capacitor-blob-writer',
'capacitor-video-player',
'@capacitor-community/firebase-analytics',
'@capacitor-community/firebase-crashlytics',
'@capacitor-firebase/crashlytics',
'@capacitor-firebase/performance',
'@capacitor/screen-orientation',
'@capacitor/camera',
Expand Down
10 changes: 5 additions & 5 deletions libs/shared/src/services/core/crashlytics.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { Capacitor } from '@capacitor/core';
import { Device } from '@capacitor/device';
import { FirebaseCrashlytics, RecordExceptionOptions } from '@capacitor-community/firebase-crashlytics';
import { FirebaseCrashlytics, RecordExceptionOptions } from '@capacitor-firebase/crashlytics';
import { ENVIRONMENT } from '@picsa/environments';

import { PicsaAsyncService } from '../asyncService.service';
Expand All @@ -24,23 +24,23 @@ export class CrashlyticsService extends PicsaAsyncService {
}
public override async init() {
if (this.enabled) {
const { setEnabled, setUserId, setContext, sendUnsentReports } = FirebaseCrashlytics;
const { setEnabled, setUserId, sendUnsentReports, setCustomKey } = FirebaseCrashlytics;
await setEnabled({ enabled: true });
const { identifier: uuid } = await Device.getId();
await setUserId({ userId: uuid });
// populate webview useragent info
const { webViewVersion } = await Device.getInfo();
await setContext({
await setCustomKey({
key: 'userAgent',
type: 'string',
value: navigator.userAgent || '',
});
await setContext({
await setCustomKey({
key: 'webViewVersion',
type: 'string',
value: webViewVersion || '',
});
await setContext({
await setCustomKey({
key: 'pathname',
type: 'string',
value: location.pathname || '',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@awesome-cordova-plugins/network": "^6.4.0",
"@awesome-cordova-plugins/social-sharing": "^6.4.0",
"@capacitor-community/firebase-analytics": "^6.0.0",
"@capacitor-community/firebase-crashlytics": "^3.0.0",
"@capacitor-firebase/crashlytics": "^6.0.0",
"@capacitor-firebase/performance": "^6.0.0",
"@capacitor/app": "^6.0.0",
"@capacitor/browser": "^6.0.1",
Expand Down
15 changes: 9 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3275,12 +3275,15 @@ __metadata:
languageName: node
linkType: hard

"@capacitor-community/firebase-crashlytics@npm:^3.0.0":
version: 3.0.0
resolution: "@capacitor-community/firebase-crashlytics@npm:3.0.0"
"@capacitor-firebase/crashlytics@npm:^6.0.0":
version: 6.0.0
resolution: "@capacitor-firebase/crashlytics@npm:6.0.0"
peerDependencies:
"@capacitor/core": ^5.0.0
checksum: 60b612896cd077dae0cbb9103bca3a2660199e13463a15e28bbf1260d9dd76148fee65f643cc8df3888b43dfccb7b7aad006f142397a23deec8cf266cdc7d07a
"@capacitor/core": ^6.0.0
peerDependenciesMeta:
firebase:
optional: true
checksum: 55ff292d7a7bb631105456256ee7437158746830c2986fe26a89add8ccca9b21b0125635c7e2557d2f1948684374293ee3dc2ad14055b85a18ee7e84791ee428
languageName: node
linkType: hard

Expand Down Expand Up @@ -19403,7 +19406,7 @@ __metadata:
"@awesome-cordova-plugins/social-sharing": ^6.4.0
"@biesbjerg/ngx-translate-extract-marker": ^1.0.0
"@capacitor-community/firebase-analytics": ^6.0.0
"@capacitor-community/firebase-crashlytics": ^3.0.0
"@capacitor-firebase/crashlytics": ^6.0.0
"@capacitor-firebase/performance": ^6.0.0
"@capacitor/android": ^6.1.0
"@capacitor/app": ^6.0.0
Expand Down

0 comments on commit 00a33f1

Please sign in to comment.