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

Commit e675c2b

Browse files
EddyVerbruggeneddyverbruggen
authored andcommitted
Feature Request: Support crash log API #307
1 parent ca51d71 commit e675c2b

File tree

4 files changed

+61
-37
lines changed

4 files changed

+61
-37
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
<img src="docs/images/firebase-logo.png" width="116px" height="32px" alt="Firebase"/>
22

33

4+
## 3.10.2 (2017, March 12)
5+
6+
[Full changelog](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/compare/3.10.1...3.10.2)
7+
8+
### SDK versions
9+
10+
If version numbers __changed__, clean your platform folders to avoid build errors.
11+
Also, for Android update your Google Repository in the Android SDK manager (type `android` on the command prompt),
12+
and for iOS do a `pod repo update` to fetch the latest versions from Cocoapods.
13+
14+
- iOS: 3.13.x
15+
- Android: 10.2.x
16+
17+
### New
18+
- [#307](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/307) Feature Request: Support crash log API
19+
20+
### Fixes
21+
- [#272](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/272) Unusual error message when retrieving data set and binding to layout
22+
- [#292](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/292) Nativescript app is not running with Firebase in IOS.
23+
24+
25+
26+
427
## 3.10.1 (2017, February 22)
528

629
[Full changelog](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/compare/3.10.0...3.10.1)

firebase.android.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,7 +1729,6 @@ firebase.unsubscribeFromTopic = function(topicName){
17291729
});
17301730
};
17311731

1732-
/*
17331732
firebase.sendCrashLog = function (arg) {
17341733
return new Promise(function (resolve, reject) {
17351734
try {
@@ -1739,19 +1738,18 @@ firebase.sendCrashLog = function (arg) {
17391738
return;
17401739
}
17411740

1742-
if (!arg.log) {
1743-
reject("The mandatory 'log' argument is missing");
1741+
if (!arg.message) {
1742+
reject("The mandatory 'message' argument is missing");
17441743
return;
17451744
}
17461745

1747-
com.google.firebase.crash.FirebaseCrash.log(arg.log);
1746+
com.google.firebase.crash.FirebaseCrash.log(arg.message);
17481747
resolve();
17491748
} catch (ex) {
17501749
console.log("Error in firebase.sendCrashLog: " + ex);
17511750
reject(ex);
17521751
}
17531752
});
17541753
};
1755-
*/
17561754

17571755
module.exports = firebase;

firebase.d.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,12 @@ export interface SendCrashLogOptions {
459459
/**
460460
* Any custom logging you want to send to Firebase.
461461
*/
462-
log: string;
462+
message: string;
463+
464+
/**
465+
* Also log to the device console. Default false.
466+
*/
467+
showInConsole: boolean;
463468
}
464469

465470
export function init(options?: InitOptions): Promise<any>;
@@ -665,5 +670,6 @@ export function deleteFile(options: DeleteFileOptions): Promise<any>;
665670
export function subscribeToTopic(topicName): Promise<any>;
666671

667672
export function unsubscribeFromTopic(topicName): Promise<any>;
673+
668674
// crash logging
669-
// export function sendCrashLog(options: SendCrashLogOptions): Promise<any>;
675+
export function sendCrashLog(options: SendCrashLogOptions): Promise<any>;

firebase.ios.js

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,37 +1742,34 @@ firebase.unsubscribeFromTopic = function(topicName){
17421742
reject(ex);
17431743
}
17441744
});
1745-
}
1745+
};
1746+
1747+
firebase.sendCrashLog = function (arg) {
1748+
return new Promise(function (resolve, reject) {
1749+
try {
1750+
if (typeof(FIRCrashLog) === "undefined") {
1751+
reject("Make sure 'Firebase/Crash' is in the plugin's Podfile - and if it is there's currently a problem with this Pod which is outside out span of control :(");
1752+
return;
1753+
}
1754+
1755+
if (!arg.message) {
1756+
reject("The mandatory 'message' argument is missing");
1757+
return;
1758+
}
17461759

1747-
/*
1748-
firebase.sendCrashLog = function (arg) {
1749-
return new Promise(function (resolve, reject) {
1750-
try {
1751-
1752-
if (typeof(FIRCrashLog) === "undefined") {
1753-
reject("Make sure 'Firebase/Crash' is in the plugin's Podfile");
1754-
return;
1755-
}
1756-
1757-
if (!arg.log) {
1758-
reject("The mandatory 'log' argument is missing");
1759-
return;
1760-
}
1761-
1762-
if (showInConsole) {
1763-
FIRCrashNSLog(arg.log);
1764-
} else {
1765-
FIRCrashLog(arg.log);
1766-
}
1767-
1768-
resolve();
1769-
} catch (ex) {
1770-
console.log("Error in firebase.sendCrashLog: " + ex);
1771-
reject(ex);
1772-
}
1773-
});
1774-
};
1775-
*/
1760+
if (arg.showInConsole) {
1761+
FIRCrashNSLog(arg.message);
1762+
} else {
1763+
FIRCrashLog(arg.message);
1764+
}
1765+
1766+
resolve();
1767+
} catch (ex) {
1768+
console.log("Error in firebase.sendCrashLog: " + ex);
1769+
reject(ex);
1770+
}
1771+
});
1772+
};
17761773

17771774
var GADBannerViewDelegateImpl = (function (_super) {
17781775
__extends(GADBannerViewDelegateImpl, _super);

0 commit comments

Comments
 (0)