Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
9e273858
Commit
9e273858
authored
Jul 22, 2017
by
Lucio Maciel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial Crashlytics support
parent
ac8ea75a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
12 deletions
+34
-12
build.gradle
app/build.gradle
+11
-0
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+3
-0
RocketChatApplication.java
.../main/java/chat/rocket/android/RocketChatApplication.java
+3
-0
LogIfError.java
app/src/main/java/chat/rocket/android/helper/LogIfError.java
+12
-9
Logger.java
app/src/main/java/chat/rocket/android/helper/Logger.java
+5
-3
No files found.
app/build.gradle
View file @
9e273858
apply
plugin:
'com.android.application'
apply
plugin:
'io.fabric'
repositories
{
maven
{
url
'https://maven.fabric.io/public'
}
}
apply
plugin:
'kotlin-android'
apply
plugin:
'me.tatarka.retrolambda'
apply
plugin:
'com.jakewharton.hugo'
...
...
@@ -9,6 +15,7 @@ buildscript {
repositories
{
jcenter
()
mavenCentral
()
maven
{
url
'https://maven.fabric.io/public'
}
}
dependencies
{
classpath
'com.android.tools.build:gradle:2.3.3'
...
...
@@ -22,6 +29,7 @@ buildscript {
classpath
'com.jakewharton.hugo:hugo-plugin:1.2.1'
classpath
'com.google.gms:google-services:3.0.0'
classpath
'com.github.triplet.gradle:play-publisher:1.1.5'
classpath
'io.fabric.tools:gradle:1.+'
}
// Exclude the version that the android plugin depends on.
...
...
@@ -134,6 +142,9 @@ dependencies {
compile
"com.github.hotchemi:permissionsdispatcher:$permissionsdispatcherVersion"
annotationProcessor
"com.github.hotchemi:permissionsdispatcher-processor:$permissionsdispatcherVersion"
compile
(
'com.crashlytics.sdk.android:crashlytics:2.6.8@aar'
)
{
transitive
=
true
;
}
}
apply
plugin:
'com.google.gms.google-services'
app/src/main/AndroidManifest.xml
View file @
9e273858
...
...
@@ -69,5 +69,8 @@
<action
android:name=
"com.google.android.gms.iid.InstanceID"
/>
</intent-filter>
</service>
<meta-data
android:name=
"io.fabric.ApiKey"
android:value=
"12ac6e94f850aaffcdff52001af77ca415d06a43"
/>
</application>
</manifest>
\ No newline at end of file
app/src/main/java/chat/rocket/android/RocketChatApplication.java
View file @
9e273858
...
...
@@ -2,9 +2,11 @@ package chat.rocket.android;
import
android.os.StrictMode
;
import
android.support.multidex.MultiDexApplication
;
import
com.crashlytics.android.Crashlytics
;
import
com.facebook.stetho.Stetho
;
import
com.uphyca.stetho_realm.RealmInspectorModulesProvider
;
import
io.fabric.sdk.android.Fabric
;
import
java.util.List
;
import
chat.rocket.android.helper.OkHttpHelper
;
import
chat.rocket.persistence.realm.RealmStore
;
...
...
@@ -24,6 +26,7 @@ public class RocketChatApplication extends MultiDexApplication {
}
super
.
onCreate
();
Fabric
.
with
(
this
,
new
Crashlytics
());
RocketChatPersistenceRealm
.
init
(
this
);
...
...
app/src/main/java/chat/rocket/android/helper/LogIfError.java
View file @
9e273858
package
chat
.
rocket
.
android
.
helper
;
import
com.crashlytics.android.Crashlytics
;
import
com.google.firebase.crash.FirebaseCrash
;
import
bolts.Continuation
;
...
...
@@ -11,14 +12,16 @@ import chat.rocket.android.log.RCLog;
* Bolts-Task continuation for just logging if error occurred.
*/
public
class
LogIfError
implements
Continuation
{
@Override
public
Object
then
(
Task
task
)
throws
Exception
{
if
(
task
.
isFaulted
())
{
if
(
BuildConfig
.
DEBUG
)
{
RCLog
.
w
(
task
.
getError
());
}
FirebaseCrash
.
report
(
task
.
getError
());
@Override
public
Object
then
(
Task
task
)
throws
Exception
{
if
(
task
.
isFaulted
())
{
if
(
BuildConfig
.
DEBUG
)
{
RCLog
.
w
(
task
.
getError
());
}
FirebaseCrash
.
report
(
task
.
getError
());
Crashlytics
.
logException
(
task
.
getError
());
}
return
task
;
}
return
task
;
}
}
app/src/main/java/chat/rocket/android/helper/Logger.java
View file @
9e273858
package
chat
.
rocket
.
android
.
helper
;
import
com.crashlytics.android.Crashlytics
;
import
com.google.firebase.crash.FirebaseCrash
;
public
class
Logger
{
public
static
void
report
(
Throwable
throwable
)
{
FirebaseCrash
.
report
(
throwable
);
}
public
static
void
report
(
Throwable
throwable
)
{
FirebaseCrash
.
report
(
throwable
);
Crashlytics
.
logException
(
throwable
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment