Giter Site home page Giter Site logo

space.vu-fabric-plugin's Introduction

Fabric Plugin for Cordova > 3.0 (iOS and Android)

Installation

  1. Make sure that you have Node and Cordova CLI or PhoneGap's CLI installed on your machine.

  2. (Important) Add Fabric SDK to the Android / iOS project Fabric.io

  3. Follow the steps to setup the SDK in your project.

  4. Add a plugin to your project using Cordova CLI:

cordova plugin add https://github.com/sarriaroman/FabricPlugin

Or using PhoneGap CLI:

phonegap local plugin add https://github.com/sarriaroman/FabricPlugin

Modules

  • Core

This module is intended to contain the core and generic features

window.fabric.core
  • Answers

This module contains the Crashlytics Answers API. This is not yet complete but has all the mayor features

window.fabric.Answers
  • Crashlytics

This module has the Crashlytics features

window.fabric.Crashlytics

Usage

Answers

Example

// Register a successful login
window.fabric.Answers.sendLogIn();

Methods

sendLogIn()

Sends a login event

sendSignUp()

Sends a SignUp event

sendContentView(name, type, id, attributes)

Sends a Content View event with the parameters:

  • Name: name of View
  • type: Type of View
  • id: the ID of the View
  • attributes: Object containing extra attributes to be set in the event ( Must be an Object )

sendScreenView(name, id, attributes)

Sends a Content View with Screen parameter in the type. Required parameters:

  • Name: name of View
  • id: the ID of the View
  • attributes: Object containing extra attributes to be set in the event ( Must be an Object )

sendCustomEvent(name, attributes)

Sends a Custom Event. Required parameters:

  • Name: name of View
  • attributes: Object containing custom information to be set in the event ( Must be an Object )

Crashlytics

function sendCrashWithData() {
	window.fabric.Crashlytics.setUserIdentifier('TheIdentifier');
    window.fabric.Crashlytics.setUserName('My Name');
    window.fabric.Crashlytics.setUserEmail('[email protected]');

    window.fabric.Crashlytics.setStringValueForKey('MyString', 'stringkey');
    window.fabric.Crashlytics.setIntValueForKey(200, 'intkey');
    window.fabric.Crashlytics.setBoolValueForKey(true, 'boolkey');
    window.fabric.Crashlytics.setFloatValueForKey(1.5, 'floatkey');

    window.fabric.Crashlytics.addLog('This my a log message from JS!');
    window.fabric.Crashlytics.addLog('This is another log message from JS!');
    window.fabric.Crashlytics.sendCrash();
}

Methods

setUserIdentifier(value)

Set the user identifier value

setUserName(value) - iOS, Android

Set the username

setUserEmail(value) - iOS, Android

Set the user email

setStringValueForKey(value, key) - iOS, Android

Set String value for key

setIntValueForKey(value, key) - iOS, Android

Set integer value for key

setBoolValueForKey(value, key) - iOS, Android

Set boolean for key

setFloatValueForKey(value, key) - iOS, Android

Set float for key

addLog(value) - iOS, Android

Add log for the crash.

sendCrash() - iOS, Android

Send a (fatal) crash to the backand of CrashLytics.

Changes

  • Javascript code moved to ES6
  • Separated in modules
  • Full support for both OSs with same API

ToDo

  • Implement missing events from Answers API
  • Move to the entire Fabric API instead of Just Crashlytics

AUTHORS

space.vu-fabric-plugin's People

Contributors

sarriaroman avatar

Watchers

Summer Knight avatar Micah Maligie avatar James Cloos 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.