Git Product home page Git Product logo

titanium-crashlytics's Introduction

Crashlytics in Appcelerator Titanium

Use the native Fabric Crashlytics iOS / Android SDK in Appcelerator Titanium.

Requirements

  • iOS: Titanium SDK 7.3.0+
  • Android: Titanium SDK 7.0.0+

Setup

In general, remember to not use any Crashlytics API's before actually opening your first window. While this might not result in a crash on iOS, the native Android SDK will error if being used before your app finished launching due to requiring the native Activity.

iOS

  1. Create a new folder scripts/ in your project root
  2. Inside scripts/, create a script-titanium-crashlytics.sh with the following contents (replace the version with your version):
# Do not run this file manually! It is referenced from your native Xcode project
"../../modules/iphone/ti.crashlytics/1.2.1/platform/Fabric.framework/uploadDSYM" <YOUR_API_KEY> <YOUR_SECRET_KEY>

2a. If using Firebase, remember to have your GoogleService-Info.plist in place, as described here. 3. Add your API key to the plist section of your tiapp.xml:

  <key>Fabric</key>
  <dict>
    <key>APIKey</key>
    <string>YOUR_API_KEY</string>
    <key>Kits</key>
    <array>
      <dict>
        <key>KitInfo</key>
        <dict/>
        <key>KitName</key>
        <string>Crashlytics</string>
      </dict>
    </array>
  </dict>
  1. You are ready to go!

Android

  1. Add the following to the <application> tag inside the manifest configuration in your tiapp.xml:
<meta-data android:name="io.fabric.ApiKey" android:value="YOUR_API_KEY" />
  1. Add your GUID or a random UUID to [app]/platform/android/res/values/strings:
<string name="com.crashlytics.android.build_id">RANDOM_UUID</string>
  1. You are ready to go!

Example

See the Sample App for an example of configuring the required API keys and project settings.

API's

crash()

Simulate a crash (for testing purpose)

throwException()

Simulate an exception (for testing purpose)

throwCustomException(String message, String myline, String sourceNameAndroid, String lineSource, String javascriptStack)

Used with EventListener "uncaughtException" function(evt)

example: Crashlytics.throwCustomException(evt.message,evt.line,evt.sourceName,evt.lineSource,evt.javascriptStack.toString());

log(message, params)

Log a Custom Event to see user actions that are uniquely important for your app in real-time. The params parameter is an iOS-only Object.

setUserIdentifier(userIdentifier)

Specify a user identifier which will be visible in the Crashlytics UI.

setUserName(userName)

Specify a user name which will be visible in the Crashlytics UI.

setUserEmail(userEmail)

Specify a user email which will be visible in the Crashlytics UI.

recordCustomException(params)

(iOS only!)

This method can be used to record a single exception structure in a report.

Author

Hans Knöchel (@hansemannnn / Web)

License

MIT

Contributing

Code contributions are greatly appreciated, please submit a new Pull-Request!

titanium-crashlytics's People

Contributors

hansemannn avatar bubinf avatar rlustemberg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.