Skip to content

Commit e7c5ff9

Browse files
committed
chore(demo): update
1 parent 2453f80 commit e7c5ff9

File tree

6 files changed

+17
-24
lines changed

6 files changed

+17
-24
lines changed

apps/demo-angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
},
2323
"devDependencies": {
2424
"@nativescript/android": "~8.2.0",
25-
"@nativescript/ios": "~8.2.0"
25+
"@nativescript/ios": "~8.2.3"
2626
}
2727
}

apps/demo-vue/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
},
2424
"devDependencies": {
2525
"@nativescript/android": "~8.2.0",
26-
"@nativescript/ios": "~8.2.0"
26+
"@nativescript/ios": "~8.2.3"
2727
}
2828
}

apps/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
},
2727
"devDependencies": {
2828
"@nativescript/android": "~8.2.0",
29-
"@nativescript/ios": "~8.2.0"
29+
"@nativescript/ios": "~8.2.3"
3030
}
3131
}

apps/demo/src/app.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@ import { Admob } from '@nativescript/firebase-admob';
2020
import { AppCheck } from '@nativescript/firebase-app-check-debug';
2121

2222
AppCheck.setProviderFactory();
23-
24-
firebase().initializeApp().then(app =>{
25-
firebase().appCheck().activate(true);
26-
})
23+
declare const TNSFirebaseCore;
24+
firebase()
25+
.initializeApp()
26+
.then((app) => {
27+
firebase().appCheck().activate(true);
28+
firebase().crashlytics().setCrashlyticsCollectionEnabled(true);
29+
});
2730

2831
Admob.init();
2932

@@ -58,5 +61,4 @@ messaging
5861
console.error('requestPermission', e);
5962
});
6063

61-
6264
Application.run({ moduleName: 'app-root' });

apps/demo/src/plugin-demos/firebase-crashlytics.ts

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,28 @@ export class DemoModel extends DemoSharedFirebaseCrashlytics {
1414
constructor() {
1515
super();
1616
this.crashlytics = firebase().crashlytics();
17-
this.crashlytics.setCrashlyticsCollectionEnabled(true);
18-
//this.crash();
19-
this.logError();
2017
}
2118

2219
logError() {
20+
//this.crashlytics.setCrashlyticsCollectionEnabled(true);
21+
// this.crashlytics.crash();
2322
this.crashlytics.setAttributes({
2423
name: 'logError',
2524
});
26-
this.crashlytics.log('Thing');
25+
this.crashlytics.log('Thing ' + new Date());
2726
if (global.isIOS) {
2827
let userInfo = {};
29-
userInfo[NSLocalizedDescriptionKey] = 'NativeScript Error Test';
28+
userInfo[NSLocalizedDescriptionKey] = 'NativeScript iOS Error Test';
3029
const ns = NSError.alloc().initWithDomainCodeUserInfo(NSCocoaErrorDomain, -1001, userInfo as any);
3130
this.crashlytics.recordError(ns);
3231
}
3332

3433
if (global.isAndroid) {
35-
const exc = new java.lang.Exception('NativeScript Error Test');
34+
const exc = new java.lang.Exception('NativeScript Android Error Test');
3635
this.crashlytics.recordError(exc);
3736
}
3837

39-
this.crashlytics.sendUnsentReports();
40-
this.crashlytics
41-
.checkForUnsentReports()
42-
.then((val) => {
43-
console.log('checkForUnsentReports', val);
44-
})
45-
.catch((e) => {
46-
console.error('checkForUnsentReports', e);
47-
});
38+
this.crashlytics.recordError(new Error('NativeScript Error Test ' + new Date()));
4839
}
4940

5041
crash() {

apps/demo/src/plugin-demos/firebase-crashlytics.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<StackLayout class="p-20">
77
<ScrollView class="h-full">
88
<StackLayout>
9-
<Button text="Test firebase-crashlytics" tap="{{ testIt }}" class="btn btn-primary"/>
9+
<Button text="Test firebase-crashlytics" tap="{{ logError }}" class="btn btn-primary"/>
1010

1111
</StackLayout>
1212
</ScrollView>

0 commit comments

Comments
 (0)