Go to console

CrashlyticsCore

public class CrashlyticsCore extends Kit<Void>

Nested Class Summary

class CrashlyticsCore.Builder Fluent API for creating CrashlyticsCore instances. 

Constant Summary

String TAG

Public Constructor Summary

Public Method Summary

void
crash()
The easiest way to cause a crash - great for testing!
String
getIdentifier()
Must be implemented by Kit to allow plugin on-boarding
static CrashlyticsCore
PinningInfoProvider
String
void
log(int priority, String tag, String msg)
Add text logging that will be sent with your next report, using log(String).
void
log(String msg)
Add text logging that will be sent with your next report.
void
logException(Throwable throwable)
Logs a non-fatal Throwable on the Crashlytics servers.
void
setBool(String key, boolean value)
Sets a value to be associated with a given key for your crash data.
void
setDouble(String key, double value)
Sets a value to be associated with a given key for your crash data.
void
setFloat(String key, float value)
Sets a value to be associated with a given key for your crash data.
void
setInt(String key, int value)
Sets a value to be associated with a given key for your crash data.
synchronized void
setListener(CrashlyticsListener listener)
This method was deprecated. use listener(CrashlyticsListener) instead
void
setLong(String key, long value)
Sets a value to be associated with a given key for your crash data.
void
setString(String key, String value)
Set a value to be associated with a given key for your crash data.
void
setUserEmail(String email)
Optionally set a end-user's name or username for display within the Crashlytics UI.
void
setUserIdentifier(String identifier)
Many of our customers have requested the ability to tie crashes to specific end-users of their application in order to facilitate responses to support requests or permit the ability to reach out for more information.
void
setUserName(String name)
Optionally set a end-user's name or username for display within the Crashlytics UI.
boolean
verifyPinning(URL url)
Helper method to verify SSL pinning is properly configured.

Protected Method Summary

Void
doInBackground()
For heavy work to be done in initialization process on a background thread.
boolean
onPreExecute()
Called before initialization on the UI thread

Inherited Method Summary

Constants

public static final String TAG

Constant Value: "CrashlyticsCore"

Public Constructors

public CrashlyticsCore ()

Public Methods

public void crash ()

The easiest way to cause a crash - great for testing!

public String getIdentifier ()

Must be implemented by Kit to allow plugin on-boarding

Returns
  • unique identifier

public static CrashlyticsCore getInstance ()

Returns
  • the CrashlyticsCore singleton.

public PinningInfoProvider getPinningInfoProvider ()

public String getVersion ()

Returns
  • Kit Version

public void log (int priority, String tag, String msg)

Add text logging that will be sent with your next report, using log(String). The message will also be printed to LogCat using android.util.Log.println(priority, tag, msg).

Parameters
priority The priority/type constant of this log message, as defined in android.util.Log. One of: ERROR, WARN, INFO, DEBUG, VERBOSE.
tag Used to identify the source of a log message. It usually identifies the class or activity where the log call occurs.
msg The message you would like logged.

public void log (String msg)

Add text logging that will be sent with your next report. This logging will only be visible in your Crashlytics dashboard, and will be associated with the next crash or logged exception for this app execution. Newline characters ('\n') will be stripped from msg. The log is rolling with a maximum size of 64k, such that messages are removed (oldest first) if the max size is exceeded.

Parameters
msg

public void logException (Throwable throwable)

Logs a non-fatal Throwable on the Crashlytics servers. Crashlytics will analyze the Throwable and create a new issue or add it to an existing issue, as appropriate. To ensure accurate reporting, this method must be invoked from the thread on which the Throwable was thrown. The Throwable will always be processed on a background thread, so it is safe to invoke this method from the main thread.

Parameters
throwable

public void setBool (String key, boolean value)

Sets a value to be associated with a given key for your crash data.

Parameters
key
value

public void setDouble (String key, double value)

Sets a value to be associated with a given key for your crash data.

Parameters
key
value

public void setFloat (String key, float value)

Sets a value to be associated with a given key for your crash data.

Parameters
key
value

public void setInt (String key, int value)

Sets a value to be associated with a given key for your crash data.

Parameters
key
value

public synchronized void setListener (CrashlyticsListener listener)

This method was deprecated.
use listener(CrashlyticsListener) instead

Parameters
listener

public void setLong (String key, long value)

Sets a value to be associated with a given key for your crash data.

Parameters
key
value

public void setString (String key, String value)

Set a value to be associated with a given key for your crash data. The key/value pairs will be reported with any crash that occurs in this session. A maximum of 64 key/value pairs can be stored for any type. New keys added over that limit will be ignored. Keys and values are trimmed (trim()), and keys or values that exceed 1024 characters will be truncated.

Parameters
key
value
Throws
NullPointerException if key is null.

public void setUserEmail (String email)

Optionally set a end-user's name or username for display within the Crashlytics UI.

Parameters
email
See Also

public void setUserIdentifier (String identifier)

Many of our customers have requested the ability to tie crashes to specific end-users of their application in order to facilitate responses to support requests or permit the ability to reach out for more information. We allow you to specify up to three separate values for display within the Crashlytics UI - but please be mindful of your end-user's privacy. We recommend specifying a user identifier - an arbitrary string that ties an end-user to a record in your system. This could be a database id, hash, or other value that is meaningless to a third-party observer but can be indexed and queried by you. Optionally, you may also specify the end-user's name or username, as well as email address if you do not have a system that works well with obscured identifiers. Pursuant to our EULA, this data is transferred securely throughout our system and we will not disseminate end-user data unless required to by law. That said, if you choose to provide end-user contact information, we strongly recommend that you disclose this in your application's privacy policy. Data privacy is of our utmost concern. Any user identifier information longer than 1024 characters will be truncated.

Parameters
identifier

public void setUserName (String name)

Optionally set a end-user's name or username for display within the Crashlytics UI.

Parameters
name
See Also

public boolean verifyPinning (URL url)

Helper method to verify SSL pinning is properly configured. This method is most appropriately used during testing and not production, as Fabric.with must be invoked prior to executing.

Parameters
url
Returns
  • true if PinningInfoProvider is assigned and a GET to the given URL returns a 200-range response, false otherwise. It will not throw an exception although the exception will be logged as an error.

Protected Methods

protected Void doInBackground ()

For heavy work to be done in initialization process on a background thread. The thread is run on the ExecutorService

protected boolean onPreExecute ()

Called before initialization on the UI thread