Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit d12db3d

Browse files
Not able to add screen logs in Firebase Analytics on android device after upgrading to version from 9.1.1 to 10.0.0 #1415
1 parent 06786d0 commit d12db3d

File tree

5 files changed

+28
-7
lines changed

5 files changed

+28
-7
lines changed
Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
{
2-
"external_push_client_only": true,
3-
"using_ios": true,
4-
"using_android": true
5-
}
2+
"using_ios": true,
3+
"using_android": true,
4+
"analytics": true,
5+
"firestore": false,
6+
"realtimedb": false,
7+
"authentication": false,
8+
"remote_config": false,
9+
"performance_monitoring": false,
10+
"external_push_client_only": true,
11+
"messaging": false,
12+
"in_app_messaging": false,
13+
"crashlytics": false,
14+
"storage": false,
15+
"functions": false,
16+
"facebook_auth": false,
17+
"google_auth": false,
18+
"admob": false,
19+
"dynamic_links": false,
20+
"ml_kit": false
21+
}

src/analytics/analytics-common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { LogEventParameter } from "./analytics";
22

3-
export const ENABLE_ANALYTICS_HINT = "Add 'analytics: true' to firebase.nativescript.json and remove the platforms folder";
3+
export const ENABLE_ANALYTICS_HINT = "⚠️ You're calling an Analytics function but have not enabled it. Please add 'analytics: true' to 'firebase.nativescript.json' and remove the 'node_modules' and 'platforms' folders.";
44

55
export function validateAnalyticsKey(key: string): string | undefined {
66
if (key === undefined || key === null) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const ENABLE_CRASHLYTICS_HINT = "⚠️ You're calling a Crashlytics function but have not enabled it. Please add 'crashlytics: true' to 'firebase.nativescript.json' and remove the 'node_modules' and 'platforms' folders.";

src/crashlytics/crashlytics.android.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { ENABLE_CRASHLYTICS_HINT } from "./crashlytics-common";
2+
13
declare const com: any;
24

35
export function sendCrashLog(exception: any /* java.lang.Exception */): void {
@@ -68,7 +70,7 @@ export function setCrashlyticsCollectionEnabled(enabled: boolean): void {
6870

6971
function isCrashlyticsAvailable(): boolean {
7072
if (typeof (com.crashlytics) === "undefined" || typeof (com.crashlytics.android.Crashlytics) === "undefined") {
71-
console.log("Add 'crashlytics: true' to firebase.nativescript.json and remove the platforms folder");
73+
console.log(ENABLE_CRASHLYTICS_HINT);
7274
return false;
7375
}
7476
return true;

src/crashlytics/crashlytics.ios.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { ENABLE_CRASHLYTICS_HINT } from "./crashlytics-common";
2+
13
export function sendCrashLog(exception: any /* NSError */): void {
24
if (isCrashlyticsAvailable()) {
35
Crashlytics.sharedInstance().recordError(exception);
@@ -65,7 +67,7 @@ export function setCrashlyticsCollectionEnabled(enabled: boolean): void {
6567

6668
function isCrashlyticsAvailable(): boolean {
6769
if (typeof (Crashlytics) === "undefined") {
68-
console.log("Add 'crashlytics: true' to firebase.nativescript.json and remove the platforms folder");
70+
console.log(ENABLE_CRASHLYTICS_HINT);
6971
return false;
7072
}
7173
return true;

0 commit comments

Comments
 (0)