All Projects → sarriaroman → Fabricplugin

sarriaroman / Fabricplugin

Licence: mit
Fabric.io plugin for Cordova or Phonegap

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Fabricplugin

React Native Fabric
A React Native library for Fabric, Crashlytics and Answers
Stars: ✭ 1,291 (+542.29%)
Mutual labels:  fabric, crashlytics
Debt-Manager
A personal app to store people that owe you money or you owe money to. "Mo Money Mo Problems" 🎵 - The Notorious B.I.G. 😎
Stars: ✭ 22 (-89.05%)
Mutual labels:  fabric, crashlytics
Just Another Android App
An Android base app with loads of cool libraries/configuration NOT MAINTAINED
Stars: ✭ 1,654 (+722.89%)
Mutual labels:  fabric, crashlytics
Cordova Plugin Firebase
Cordova plugin for Google Firebase
Stars: ✭ 997 (+396.02%)
Mutual labels:  crashlytics, cordova
Crashlyticsdemo
Setup Fabric Crashlytics CI friendly
Stars: ✭ 142 (-29.35%)
Mutual labels:  fabric, crashlytics
Cordova App Hello World
Apache Cordova Template App
Stars: ✭ 170 (-15.42%)
Mutual labels:  cordova
Wehousing
Golang微服务+区块链实战---go+micro+fabric实现租房上链系统
Stars: ✭ 182 (-9.45%)
Mutual labels:  fabric
Cordova Ios
Apache Cordova iOS
Stars: ✭ 2,031 (+910.45%)
Mutual labels:  cordova
Cordova Create React App
A tutorial on how to set up a Cordova project using Create React App.
Stars: ✭ 167 (-16.92%)
Mutual labels:  cordova
Admob Plus
Trustable AdMob Plugin for Cordova, Capacitor, Ionic
Stars: ✭ 195 (-2.99%)
Mutual labels:  cordova
Polyonic
An Electron Ionic application shell for creating Web Apps, Progressive Mobile Web Apps, Native Mobile Apps and Desktop Apps.
Stars: ✭ 187 (-6.97%)
Mutual labels:  cordova
Dvhma
Damn Vulnerable Hybrid Mobile App (DVHMA) is an hybrid mobile app (for Android) that intentionally contains vulnerabilities.
Stars: ✭ 180 (-10.45%)
Mutual labels:  cordova
Kitten
Tiny multi-server automation tool
Stars: ✭ 171 (-14.93%)
Mutual labels:  fabric
Data Visualization
数据可视化
Stars: ✭ 184 (-8.46%)
Mutual labels:  fabric
Cordova Plugin Document Viewer
A Document Viewer cordova/phonegap plugin for iOS, Android and Windows
Stars: ✭ 168 (-16.42%)
Mutual labels:  cordova
Cordova Windows
Apache Cordova Windows
Stars: ✭ 188 (-6.47%)
Mutual labels:  cordova
Vue Objccn
🔥 Use Vue.js to develop a cross-platform full stack application / 用 Vue.js 开发的跨三端应用
Stars: ✭ 1,993 (+891.54%)
Mutual labels:  cordova
Ionic Native
Native features for mobile apps built with Cordova/PhoneGap and open web technologies. Complete with TypeScript support.
Stars: ✭ 2,129 (+959.2%)
Mutual labels:  cordova
Ui Fabric Android
This repo has been moved. See website for new url.
Stars: ✭ 185 (-7.96%)
Mutual labels:  fabric
Vue Movie
基于vue2.0构建的在线电影网【film】,webpack+vue+vuex+keepAlive+muse-ui+cordova 全家桶,打包成APP
Stars: ✭ 175 (-12.94%)
Mutual labels:  cordova

Fabric Plugin for Cordova

Backers on Open Collective Sponsors on Open Collective

This is a Cordova plugin for Fabric.io's Crashlytics and Answers services.

It requires Cordova 6.x or newer (tested on 7.0.0) and has APIs for iOS and Android.

The iOS version uses Fabric SDK 1.7.5 and Crashlytics SDK 3.10.1 framework bundles which are located in lib/ios.

The Android version uses Gradle to get the Fabric SDK (io.fabric.tools:gradle:1.+) and the Crashlytics SDK (com.crashlytics.sdk.android:crashlytics:2.9.1) from Maven repositories when the plugin is added.

Install

  1. Make sure that you have Node and Cordova CLI or PhoneGap's CLI installed on your machine.
  2. Setup your Fabric.io account and get your API Key and Build Secret from your organization page.
  3. Add a plugin to your project using Cordova CLI, specifying the keys with the --variable argument:
# Install from npm registry:
cordova plugin add cordova-fabric-plugin --variable FABRIC_API_KEY=XXX --variable FABRIC_API_SECRET=xxx

# Or to install directly from github:
# (replace x.x.x with the tag of the version your want, or omit for HEAD)
cordova plugin add https://github.com/sarriaroman/FabricPlugin#x.x.x  --variable FABRIC_API_KEY=XXX --variable FABRIC_API_SECRET=xxx

Note: If you have never registered an app with your organization, the organization page may redirect you to a wizard preventing you from obtaining your keys. You may be able to obtain your keys from this page. Scroll down to the "Run Script Build Phase" block. The first, shorter string is the API key and the second, longer string is the build secret. If that doesn't work you can follow the wizard and integrate the kit into a dummy "Hello World" project which should then unlock the organization page.

Usage

The plugin is available via global variable named fabric. It exposes APIs for both Crashlytics and Answers.

A TypeScript definition file for the JavaScript interface is available in the typings directory.

API Documentation

See typings/cordova-fabric-plugin.d.ts for documentation of the JavaScript APIs including call signatures and parameter types.

Examples

Below are a few examples; see the API documentation for a complete list.

Simulate a Native Crash

window.fabric.Crashlytics.addLog("about to send a crash for testing!");
window.fabric.Crashlytics.sendCrash();

Send a Non Fatal Crash / Recording Errors

//Android and iOS
window.fabric.Crashlytics.addLog("about to send a non fatal crash for testing!");
window.fabric.Crashlytics.sendNonFatalCrash("Error message");

//iOS only. Send message and error code
window.fabric.Crashlytics.addLog("about to send a non fatal crash for testing!");
window.fabric.Crashlytics.recordError("Error message", -1);

//Android only. Send stack trace with non fatal crash (requires https://www.stacktracejs.com/)
window.fabric.Crashlytics.sendNonFatalCrash("Error message", StackTrace.getSync());

Issue Grouping

Crashes are grouped via stack trace analysis. Logged errors are grouped, instead, by the error domain and code. Remember that this means error issues can span many different call sites.

Set Information for Crash Reports

window.fabric.Crashlytics.setUserIdentifier("123");
window.fabric.Crashlytics.setUserName("Some Guy");
window.fabric.Crashlytics.setUserEmail("[email protected]");
window.fabric.Crashlytics.setStringValueForKey("bar", "foo");

Send a Sign Up Event

window.fabric.Answers.sendSignUp("Facebook", true);

Send a Sign Up Event (with custom attributes)

var attributes = {
    foo: "data",
    bar: true,
};

window.fabric.Answers.sendSignUp("Facebook", true, attributes);

Send a Add To Cart Event

window.fabric.Answers.sendAddToCart(29.95, "USD", "Foo Bar Shirt", "apparel", "123");

Notes

Automatic Configuration of Fabric SDKs

A normal installation for the Fabric SDKs involves downloading the Fabric tool and pointing it at your native code project. This tool takes care of adding references and modifying your build scripts and/or project files.

This plugin instead performs these steps via two build hooks located in the hooks directory: after_plugin_install and before_plugin_uninstall.

This allows you to avoid using the Fabric tool as well as omit your platforms directory from source control.

Automatic Debug Symbol Upload on Build

The Fabric SDK comes with a command line tool that takes care of uploading debug symbols after a build so that they can be used when viewing crash reports.

For iOS, our build hook adds a build script phase block to execute Fabric's uploader command line tool.

For Android, our build hook modifies the build.gradle file to delegate to Fabric's uploader Gradle task.

Updating Fabric and Crashlytics

Fabric and Crashlytics can be udpated via scripts/add-packages.sh. This script creates a temporary directory, obtains packages from their cocoapods download locations, and overwrites the frameworks in lib/ios.

To run the package update script:

npm run add-packages

The desired package versions are pulled from package.json:

"packages": {
    "fabric": "1.7.2",
    "crashlytics": "3.9.3"
}

Contributing

If you wish to contribute please see CONTRIBUTING.md.

Authors

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].