hansemannn / titanium-sentry

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sentry for Titanium SDK

Use the native Sentry SDKs (iOS & Android) in the Titanium SDK.

Sponsor

This module was sponsored by Korelogic. Go check them out today!

Requirements

  • A valid Sentry API key (create a new project here)
  • Titanium SDK 11.0.0+

Setup

iOS

  1. Import the module at the earliest possible place (e.g. app.js for classic projects or alloy.js for Alloy projects):
import Sentry from 'ti.sentry';
  1. Start the crash monitoring with additional options (or no options for the default behavior):
Sentry.start({
  dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0', // required (!)
  debugEnabled: true, // default: false
  enableAppHangTracking: true, // default: false
  attachScreenshot: true, // default: false
  attachStacktrace: true, // default: false
  attachViewHierarchy: true, // default: false
  enableAutoPerformanceTracking: true, // default: true
});

You can find all available options here. If you need additional options, feel free to file an issue on Github and I'll try to look into it. Alternatively, can can always open a pull request (remember to bump the module version in the manifest).

Android

The SDK is initialized automatically after adding the following key in the <application /> tag (in your manifest inside the tiapp.xml):

<meta-data android:name="io.sentry.dsn" android:value="https://examplePublicKey@o0.ingest.sentry.io/0" />

All additional options (like on iOS) are configured the same way, e.g ANR tracking.:

<meta-data android:name="io.sentry.anr.enable" android:value="false" />

You can find all available options here.

Additional APIs

Methods

  • setContext('key', { value1: 'hello', value2: 'world' }) -> iOS only
  • setUser({ email, userId, username, ipAddress, segment, data }) -> iOS only
  • addBreadcrumb({ level: Sentry.LEVEL_INFO, category: 'my_category', message: 'Hello world' }) -> iOS only

Author

Hans Knöchel

License

MIT

About

License:MIT License


Languages

Language:Objective-C 98.0%Language:C 0.7%Language:Swift 0.5%Language:JavaScript 0.4%Language:Kotlin 0.2%Language:Ruby 0.1%